diff --git a/Directory.Packages.props b/Directory.Packages.props
index 4159c2f1..9705c859 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -8,9 +8,13 @@
-
+
+
+
+
+
diff --git a/src/Yavsc.Server/Config.cs b/src/Yavsc.Server/Config.cs
index 4c321ef1..3fcda515 100644
--- a/src/Yavsc.Server/Config.cs
+++ b/src/Yavsc.Server/Config.cs
@@ -43,13 +43,13 @@ public static class Config
new IdentityResources.Email()
];
- public static IEnumerable TestingApiScopes =>
+ public static IEnumerable ApiScopes =>
[
new ApiScope("scope1",new string[] {"scope1"}),
new ApiScope("scope2",new string[] {"scope2"}),
];
- public static IEnumerable TestingClients =>
+ public static IEnumerable Clients =>
[
// m2m client credentials flow client
new Client
diff --git a/src/Yavsc.Server/Models/ApplicationDbContext.cs b/src/Yavsc.Server/Models/ApplicationDbContext.cs
index 2b68ed6a..d54ddaea 100644
--- a/src/Yavsc.Server/Models/ApplicationDbContext.cs
+++ b/src/Yavsc.Server/Models/ApplicationDbContext.cs
@@ -91,8 +91,6 @@ namespace Yavsc.Models
optionsBuilder.UseNpgsql(envCxStr);
base.OnConfiguring(optionsBuilder);
}
- public DbSet Applications { get; set; }
-
///
/// Activities referenced on this site
@@ -278,6 +276,5 @@ namespace Yavsc.Models
public DbSet Scopes { get; set; }
public DbSet blogSpotPublications { get; set; }
- public DbSet Client { get; set; }
}
}
diff --git a/src/Yavsc.Server/Models/Auth/Client.cs b/src/Yavsc.Server/Models/Auth/Client.cs
deleted file mode 100644
index f7ef5ef0..00000000
--- a/src/Yavsc.Server/Models/Auth/Client.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-
-namespace Yavsc.Models.Auth
-{
- public class Client
- {
- [Key][Required][DatabaseGenerated(DatabaseGeneratedOption.Identity)]
- public string Id { get; set; }
-
- [Required]
- [MaxLength(128)]
- public string DisplayName { get; set; }
-
- [MaxLength(512)]
- public string? RedirectUri { get; set; }
-
-
- [MaxLength(512)]
- public string? LogoutRedirectUri { get; set; }
- [MaxLength(512)]
- public string Secret { get; set; }
- public ApplicationTypes Type { get; set; }
-
- public bool Active { get; set; }
- public int RefreshTokenLifeTime { get; set; }
- public int AccessTokenLifetime { get; set; }
- }
-}
diff --git a/src/Yavsc/Controllers/Contracting/ClientController.cs b/src/Yavsc/Controllers/Administration/ClientController.cs
similarity index 67%
rename from src/Yavsc/Controllers/Contracting/ClientController.cs
rename to src/Yavsc/Controllers/Administration/ClientController.cs
index 7cf5e2f8..d1366a4a 100644
--- a/src/Yavsc/Controllers/Contracting/ClientController.cs
+++ b/src/Yavsc/Controllers/Administration/ClientController.cs
@@ -1,3 +1,6 @@
+using IdentityServer8.EntityFramework.DbContexts;
+using IdentityServer8.EntityFramework.Entities;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
@@ -8,19 +11,21 @@ using Yavsc.Server.Helpers;
namespace Yavsc.Controllers
{
+ [Authorize("AdministratorOnly")]
public class ClientController : Controller
{
- private readonly ApplicationDbContext _context;
+ private readonly ConfigurationDbContext _context;
- public ClientController(ApplicationDbContext context)
+ public ClientController(ConfigurationDbContext context)
{
- _context = context;
+ _context = context;
}
// GET: Client
public async Task Index()
{
- return View(await _context.Applications.ToListAsync());
+ return View(await _context.Clients.Include(c=>c.AllowedGrantTypes)
+ .Include(c=>c.RedirectUris).ToListAsync());
}
// GET: Client/Details/5
@@ -31,7 +36,11 @@ namespace Yavsc.Controllers
return NotFound();
}
- Client client = await _context.Applications.SingleAsync(m => m.Id == id);
+ Client client = await _context.Clients.Include(
+ c => c.ClientSecrets
+ ).Include(c=>c.AllowedGrantTypes)
+ .Include(c=>c.RedirectUris)
+ .SingleAsync(m => m.ClientId == id);
if (client == null)
{
return NotFound();
@@ -53,9 +62,10 @@ namespace Yavsc.Controllers
{
if (ModelState.IsValid)
{
- client.Id = Guid.NewGuid().ToString();
- _context.Applications.Add(client);
- await _context.SaveChangesAsync(User.GetUserId());
+ if (string.IsNullOrWhiteSpace(client.ClientId))
+ client.ClientId = Guid.NewGuid().ToString();
+ _context.Clients.Add(client);
+ await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
SetAppTypesInputValues();
@@ -63,16 +73,16 @@ namespace Yavsc.Controllers
}
private void SetAppTypesInputValues()
{
- IEnumerable types = new SelectListItem[] {
+ IEnumerable types = new SelectListItem[] {
new SelectListItem {
Text = ApplicationTypes.JavaScript.ToString(),
Value = ((int) ApplicationTypes.JavaScript).ToString() },
new SelectListItem {
Text = ApplicationTypes.NativeConfidential.ToString(),
- Value = ((int) ApplicationTypes.NativeConfidential).ToString()
+ Value = ((int) ApplicationTypes.NativeConfidential).ToString()
}
};
- ViewData["Type"] = types;
+ ViewData["AccessTokenType"] = types;
}
// GET: Client/Edit/5
public async Task Edit(string id)
@@ -82,7 +92,7 @@ namespace Yavsc.Controllers
return NotFound();
}
- Client client = await _context.Applications.SingleAsync(m => m.Id == id);
+ Client client = await _context.Clients.SingleAsync(m => m.ClientId == id);
if (client == null)
{
return NotFound();
@@ -99,7 +109,7 @@ namespace Yavsc.Controllers
if (ModelState.IsValid)
{
_context.Update(client);
- await _context.SaveChangesAsync(User.GetUserId());
+ await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(client);
@@ -114,7 +124,7 @@ namespace Yavsc.Controllers
return NotFound();
}
- Client client = await _context.Applications.SingleAsync(m => m.Id == id);
+ Client client = await _context.Clients.SingleAsync(m => m.ClientId == id);
if (client == null)
{
return NotFound();
@@ -128,9 +138,9 @@ namespace Yavsc.Controllers
[ValidateAntiForgeryToken]
public async Task DeleteConfirmed(string id)
{
- Client client = await _context.Applications.SingleAsync(m => m.Id == id);
- _context.Applications.Remove(client);
- await _context.SaveChangesAsync(User.GetUserId());
+ Client client = await _context.Clients.SingleAsync(m => m.ClientId == id);
+ _context.Clients.Remove(client);
+ await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
}
diff --git a/src/Yavsc/Controllers/Administration/DatabaseController.cs b/src/Yavsc/Controllers/Administration/DatabaseController.cs
index 39428a26..f85e44f4 100644
--- a/src/Yavsc/Controllers/Administration/DatabaseController.cs
+++ b/src/Yavsc/Controllers/Administration/DatabaseController.cs
@@ -1,11 +1,9 @@
-using System.IO.Compression;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using Yavsc.Models;
-using Yavsc.Models.Blog;
namespace Yavsc.Controllers
{
diff --git a/src/Yavsc/Extensions/HostingExtensions.cs b/src/Yavsc/Extensions/HostingExtensions.cs
index 3e87fbe7..239d1352 100644
--- a/src/Yavsc/Extensions/HostingExtensions.cs
+++ b/src/Yavsc/Extensions/HostingExtensions.cs
@@ -2,6 +2,11 @@ using System.Diagnostics;
using System.Globalization;
using Google.Apis.Util.Store;
using IdentityServer8;
+using Microsoft.Extensions.DependencyInjection;
+using IdentityServer8.Stores;
+using IdentityServer8.EntityFramework;
+using IdentityServer8.Extensions;
+
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.DataProtection;
@@ -29,6 +34,9 @@ using IdentityModel;
using Yavsc.Interfaces;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Npgsql;
+using System.Reflection;
+using IdentityServer8.EntityFramework.DbContexts;
+using IdentityServer8.EntityFramework.Mappers;
namespace Yavsc.Extensions;
@@ -121,7 +129,12 @@ public static class HostingExtensions
{
IServiceCollection services = builder.Services;
services.AddDbContext(options =>
- options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
+ {
+ options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"),
+ options => options.MigrationsAssembly("Yavsc")
+ );
+ }
+ );
return services.AddIdentity(
options =>
@@ -226,6 +239,9 @@ public static class HostingExtensions
}
private static IIdentityServerBuilder AddIdentityServer(WebApplicationBuilder builder)
{
+ var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
+ var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
+
var identityServerBuilder = builder.Services.AddIdentityServer(options =>
{
options.Events.RaiseErrorEvents = true;
@@ -237,10 +253,19 @@ public static class HostingExtensions
options.EmitStaticAudienceClaim = true;
})
- .AddInMemoryIdentityResources(Config.IdentityResources)
- .AddInMemoryClients(Config.TestingClients)
- .AddClientStore()
- .AddInMemoryApiScopes(Config.TestingApiScopes)
+ //.AddInMemoryIdentityResources(Config.IdentityResources)
+ //.AddInMemoryClients(Config.TestingClients)
+ //.AddInMemoryApiScopes(Config.TestingApiScopes)
+ .AddConfigurationStore(options =>
+ {
+ options.ConfigureDbContext = b => b.UseNpgsql(connectionString,
+ sql => sql.MigrationsAssembly(migrationsAssembly));
+ })
+ .AddOperationalStore(options =>
+ {
+ options.ConfigureDbContext = b => b.UseNpgsql(connectionString,
+ sql => sql.MigrationsAssembly(migrationsAssembly));
+ })
.AddAspNetIdentity();
builder.Services.Configure(options =>
@@ -370,9 +395,53 @@ public static class HostingExtensions
payPalSettings, googleAuthSettings, localization, loggerFactory,
app.Environment.EnvironmentName);
app.ConfigureFileServerApp();
-
+ app.InitializeDatabase();
return app;
}
+private static void InitializeDatabase(this IApplicationBuilder app)
+{
+ using (var serviceScope = app.ApplicationServices.GetService().CreateScope())
+ {
+ serviceScope.ServiceProvider.GetRequiredService().Database.Migrate();
+
+ var context = serviceScope.ServiceProvider.GetRequiredService();
+ try
+ {
+ context.Database.Migrate();
+ }
+ catch (Exception ex)
+ {
+ // TODO log
+ }
+
+ if (!context.Clients.Any())
+ {
+ foreach (var client in Config.Clients)
+ {
+ context.Clients.Add(client.ToEntity());
+ }
+ context.SaveChanges();
+ }
+
+ if (!context.IdentityResources.Any())
+ {
+ foreach (var resource in Config.IdentityResources)
+ {
+ context.IdentityResources.Add(resource.ToEntity());
+ }
+ context.SaveChanges();
+ }
+
+ if (!context.ApiScopes.Any())
+ {
+ foreach (var resource in Config.ApiScopes)
+ {
+ context.ApiScopes.Add(resource.ToEntity());
+ }
+ context.SaveChanges();
+ }
+ }
+}
static void LoadGoogleConfig(IConfigurationRoot configuration)
{
diff --git a/src/Yavsc.Server/Migrations/20250814102318_init.Designer.cs b/src/Yavsc/Migrations/20250824130510_init.Designer.cs
similarity index 99%
rename from src/Yavsc.Server/Migrations/20250814102318_init.Designer.cs
rename to src/Yavsc/Migrations/20250824130510_init.Designer.cs
index 464fd230..bc741b22 100644
--- a/src/Yavsc.Server/Migrations/20250814102318_init.Designer.cs
+++ b/src/Yavsc/Migrations/20250824130510_init.Designer.cs
@@ -9,10 +9,10 @@ using Yavsc.Models;
#nullable disable
-namespace Yavsc.Server.Migrations
+namespace Yavsc.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
- [Migration("20250814102318_init")]
+ [Migration("20250824130510_init")]
partial class init
{
///
@@ -702,7 +702,6 @@ namespace Yavsc.Server.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AuthorId")
- .IsRequired()
.HasColumnType("text");
b.Property("Content")
@@ -2663,9 +2662,7 @@ namespace Yavsc.Server.Migrations
{
b.HasOne("Yavsc.Models.ApplicationUser", "Author")
.WithMany("Posts")
- .HasForeignKey("AuthorId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
+ .HasForeignKey("AuthorId");
b.Navigation("Author");
});
diff --git a/src/Yavsc.Server/Migrations/20250814102318_init.cs b/src/Yavsc/Migrations/20250824130510_init.cs
similarity index 99%
rename from src/Yavsc.Server/Migrations/20250814102318_init.cs
rename to src/Yavsc/Migrations/20250824130510_init.cs
index 53226fef..070061a3 100644
--- a/src/Yavsc.Server/Migrations/20250814102318_init.cs
+++ b/src/Yavsc/Migrations/20250824130510_init.cs
@@ -4,7 +4,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
-namespace Yavsc.Server.Migrations
+namespace Yavsc.Migrations
{
///
public partial class init : Migration
@@ -800,7 +800,7 @@ namespace Yavsc.Server.Migrations
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
- AuthorId = table.Column(type: "text", nullable: false),
+ AuthorId = table.Column(type: "text", nullable: true),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
UserCreated = table.Column(type: "text", nullable: true),
DateModified = table.Column(type: "timestamp with time zone", nullable: false),
@@ -816,8 +816,7 @@ namespace Yavsc.Server.Migrations
name: "FK_BlogSpot_AspNetUsers_AuthorId",
column: x => x.AuthorId,
principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
+ principalColumn: "Id");
});
migrationBuilder.CreateTable(
diff --git a/src/Yavsc.Server/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs
similarity index 99%
rename from src/Yavsc.Server/Migrations/ApplicationDbContextModelSnapshot.cs
rename to src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs
index 8d9cff67..eee3bd27 100644
--- a/src/Yavsc.Server/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -8,7 +8,7 @@ using Yavsc.Models;
#nullable disable
-namespace Yavsc.Server.Migrations
+namespace Yavsc.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
@@ -699,7 +699,6 @@ namespace Yavsc.Server.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AuthorId")
- .IsRequired()
.HasColumnType("text");
b.Property("Content")
@@ -2660,9 +2659,7 @@ namespace Yavsc.Server.Migrations
{
b.HasOne("Yavsc.Models.ApplicationUser", "Author")
.WithMany("Posts")
- .HasForeignKey("AuthorId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
+ .HasForeignKey("AuthorId");
b.Navigation("Author");
});
diff --git a/src/Yavsc/Migrations/ConfigurationDb/20250824140319_init.Designer.cs b/src/Yavsc/Migrations/ConfigurationDb/20250824140319_init.Designer.cs
new file mode 100644
index 00000000..42e0493a
--- /dev/null
+++ b/src/Yavsc/Migrations/ConfigurationDb/20250824140319_init.Designer.cs
@@ -0,0 +1,1010 @@
+//
+using System;
+using IdentityServer8.EntityFramework.DbContexts;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Yavsc.Migrations.ConfigurationDb
+{
+ [DbContext(typeof(ConfigurationDbContext))]
+ [Migration("20250824140319_init")]
+ partial class init
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.7")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResource", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AllowedAccessTokenSigningAlgorithms")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("DisplayName")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("Enabled")
+ .HasColumnType("boolean");
+
+ b.Property("LastAccessed")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("NonEditable")
+ .HasColumnType("boolean");
+
+ b.Property("ShowInDiscoveryDocument")
+ .HasColumnType("boolean");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("ApiResources", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ApiResourceId")
+ .HasColumnType("integer");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApiResourceId");
+
+ b.ToTable("ApiResourceClaims", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceProperty", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ApiResourceId")
+ .HasColumnType("integer");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApiResourceId");
+
+ b.ToTable("ApiResourceProperties", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceScope", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ApiResourceId")
+ .HasColumnType("integer");
+
+ b.Property("Scope")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApiResourceId");
+
+ b.ToTable("ApiResourceScopes", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceSecret", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ApiResourceId")
+ .HasColumnType("integer");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("Expiration")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(4000)
+ .HasColumnType("character varying(4000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApiResourceId");
+
+ b.ToTable("ApiResourceSecrets", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScope", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("DisplayName")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("Emphasize")
+ .HasColumnType("boolean");
+
+ b.Property("Enabled")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("Required")
+ .HasColumnType("boolean");
+
+ b.Property("ShowInDiscoveryDocument")
+ .HasColumnType("boolean");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("ApiScopes", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ScopeId")
+ .HasColumnType("integer");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ScopeId");
+
+ b.ToTable("ApiScopeClaims", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeProperty", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("ScopeId")
+ .HasColumnType("integer");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ScopeId");
+
+ b.ToTable("ApiScopeProperties", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.Client", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AbsoluteRefreshTokenLifetime")
+ .HasColumnType("integer");
+
+ b.Property("AccessTokenLifetime")
+ .HasColumnType("integer");
+
+ b.Property("AccessTokenType")
+ .HasColumnType("integer");
+
+ b.Property("AllowAccessTokensViaBrowser")
+ .HasColumnType("boolean");
+
+ b.Property("AllowOfflineAccess")
+ .HasColumnType("boolean");
+
+ b.Property("AllowPlainTextPkce")
+ .HasColumnType("boolean");
+
+ b.Property("AllowRememberConsent")
+ .HasColumnType("boolean");
+
+ b.Property("AllowedIdentityTokenSigningAlgorithms")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("AlwaysIncludeUserClaimsInIdToken")
+ .HasColumnType("boolean");
+
+ b.Property("AlwaysSendClientClaims")
+ .HasColumnType("boolean");
+
+ b.Property("AuthorizationCodeLifetime")
+ .HasColumnType("integer");
+
+ b.Property("BackChannelLogoutSessionRequired")
+ .HasColumnType("boolean");
+
+ b.Property("BackChannelLogoutUri")
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.Property("ClientClaimsPrefix")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("ClientName")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("ClientUri")
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.Property("ConsentLifetime")
+ .HasColumnType("integer");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("DeviceCodeLifetime")
+ .HasColumnType("integer");
+
+ b.Property("EnableLocalLogin")
+ .HasColumnType("boolean");
+
+ b.Property("Enabled")
+ .HasColumnType("boolean");
+
+ b.Property("FrontChannelLogoutSessionRequired")
+ .HasColumnType("boolean");
+
+ b.Property("FrontChannelLogoutUri")
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.Property("IdentityTokenLifetime")
+ .HasColumnType("integer");
+
+ b.Property("IncludeJwtId")
+ .HasColumnType("boolean");
+
+ b.Property("LastAccessed")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("LogoUri")
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.Property("NonEditable")
+ .HasColumnType("boolean");
+
+ b.Property("PairWiseSubjectSalt")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("ProtocolType")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("RefreshTokenExpiration")
+ .HasColumnType("integer");
+
+ b.Property("RefreshTokenUsage")
+ .HasColumnType("integer");
+
+ b.Property("RequireClientSecret")
+ .HasColumnType("boolean");
+
+ b.Property("RequireConsent")
+ .HasColumnType("boolean");
+
+ b.Property("RequirePkce")
+ .HasColumnType("boolean");
+
+ b.Property("RequireRequestObject")
+ .HasColumnType("boolean");
+
+ b.Property("SlidingRefreshTokenLifetime")
+ .HasColumnType("integer");
+
+ b.Property("UpdateAccessTokenClaimsOnRefresh")
+ .HasColumnType("boolean");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserCodeType")
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("UserSsoLifetime")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId")
+ .IsUnique();
+
+ b.ToTable("Clients", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientClaims", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientCorsOrigin", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("Origin")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("character varying(150)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientCorsOrigins", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientGrantType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("GrantType")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientGrantTypes", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientIdPRestriction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("Provider")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientIdPRestrictions", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("PostLogoutRedirectUri")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientPostLogoutRedirectUris", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientProperty", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientProperties", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientRedirectUri", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("RedirectUri")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientRedirectUris", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientScope", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("Scope")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientScopes", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientSecret", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .HasColumnType("integer");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.Property("Expiration")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(4000)
+ .HasColumnType("character varying(4000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId");
+
+ b.ToTable("ClientSecrets", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResource", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("DisplayName")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("Emphasize")
+ .HasColumnType("boolean");
+
+ b.Property("Enabled")
+ .HasColumnType("boolean");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("NonEditable")
+ .HasColumnType("boolean");
+
+ b.Property("Required")
+ .HasColumnType("boolean");
+
+ b.Property("ShowInDiscoveryDocument")
+ .HasColumnType("boolean");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique();
+
+ b.ToTable("IdentityResources", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("IdentityResourceId")
+ .HasColumnType("integer");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IdentityResourceId");
+
+ b.ToTable("IdentityResourceClaims", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceProperty", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("IdentityResourceId")
+ .HasColumnType("integer");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("character varying(2000)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IdentityResourceId");
+
+ b.ToTable("IdentityResourceProperties", (string)null);
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceClaim", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource")
+ .WithMany("UserClaims")
+ .HasForeignKey("ApiResourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ApiResource");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceProperty", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource")
+ .WithMany("Properties")
+ .HasForeignKey("ApiResourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ApiResource");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceScope", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource")
+ .WithMany("Scopes")
+ .HasForeignKey("ApiResourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ApiResource");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceSecret", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource")
+ .WithMany("Secrets")
+ .HasForeignKey("ApiResourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ApiResource");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeClaim", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.ApiScope", "Scope")
+ .WithMany("UserClaims")
+ .HasForeignKey("ScopeId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeProperty", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.ApiScope", "Scope")
+ .WithMany("Properties")
+ .HasForeignKey("ScopeId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Scope");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientClaim", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("Claims")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientCorsOrigin", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("AllowedCorsOrigins")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientGrantType", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("AllowedGrantTypes")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientIdPRestriction", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("IdentityProviderRestrictions")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("PostLogoutRedirectUris")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientProperty", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("Properties")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientRedirectUri", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("RedirectUris")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientScope", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("AllowedScopes")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientSecret", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client")
+ .WithMany("ClientSecrets")
+ .HasForeignKey("ClientId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Client");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceClaim", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.IdentityResource", "IdentityResource")
+ .WithMany("UserClaims")
+ .HasForeignKey("IdentityResourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("IdentityResource");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceProperty", b =>
+ {
+ b.HasOne("IdentityServer8.EntityFramework.Entities.IdentityResource", "IdentityResource")
+ .WithMany("Properties")
+ .HasForeignKey("IdentityResourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("IdentityResource");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResource", b =>
+ {
+ b.Navigation("Properties");
+
+ b.Navigation("Scopes");
+
+ b.Navigation("Secrets");
+
+ b.Navigation("UserClaims");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScope", b =>
+ {
+ b.Navigation("Properties");
+
+ b.Navigation("UserClaims");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.Client", b =>
+ {
+ b.Navigation("AllowedCorsOrigins");
+
+ b.Navigation("AllowedGrantTypes");
+
+ b.Navigation("AllowedScopes");
+
+ b.Navigation("Claims");
+
+ b.Navigation("ClientSecrets");
+
+ b.Navigation("IdentityProviderRestrictions");
+
+ b.Navigation("PostLogoutRedirectUris");
+
+ b.Navigation("Properties");
+
+ b.Navigation("RedirectUris");
+ });
+
+ modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResource", b =>
+ {
+ b.Navigation("Properties");
+
+ b.Navigation("UserClaims");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/Yavsc/Migrations/ConfigurationDb/20250824140319_init.cs b/src/Yavsc/Migrations/ConfigurationDb/20250824140319_init.cs
new file mode 100644
index 00000000..a8261311
--- /dev/null
+++ b/src/Yavsc/Migrations/ConfigurationDb/20250824140319_init.cs
@@ -0,0 +1,663 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Yavsc.Migrations.ConfigurationDb
+{
+ ///
+ public partial class init : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "ApiResources",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Enabled = table.Column(type: "boolean", nullable: false),
+ Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
+ DisplayName = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
+ Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true),
+ AllowedAccessTokenSigningAlgorithms = table.Column(type: "character varying(100)", maxLength: 100, nullable: true),
+ ShowInDiscoveryDocument = table.Column(type: "boolean", nullable: false),
+ Created = table.Column(type: "timestamp with time zone", nullable: false),
+ Updated = table.Column(type: "timestamp with time zone", nullable: true),
+ LastAccessed = table.Column(type: "timestamp with time zone", nullable: true),
+ NonEditable = table.Column(type: "boolean", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ApiResources", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ApiScopes",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Enabled = table.Column(type: "boolean", nullable: false),
+ Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
+ DisplayName = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
+ Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true),
+ Required = table.Column(type: "boolean", nullable: false),
+ Emphasize = table.Column(type: "boolean", nullable: false),
+ ShowInDiscoveryDocument = table.Column(type: "boolean", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ApiScopes", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Clients",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Enabled = table.Column(type: "boolean", nullable: false),
+ ClientId = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
+ ProtocolType = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
+ RequireClientSecret = table.Column(type: "boolean", nullable: false),
+ ClientName = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
+ Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true),
+ ClientUri = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
+ LogoUri = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
+ RequireConsent = table.Column(type: "boolean", nullable: false),
+ AllowRememberConsent = table.Column(type: "boolean", nullable: false),
+ AlwaysIncludeUserClaimsInIdToken = table.Column(type: "boolean", nullable: false),
+ RequirePkce = table.Column(type: "boolean", nullable: false),
+ AllowPlainTextPkce = table.Column(type: "boolean", nullable: false),
+ RequireRequestObject = table.Column(type: "boolean", nullable: false),
+ AllowAccessTokensViaBrowser = table.Column(type: "boolean", nullable: false),
+ FrontChannelLogoutUri = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
+ FrontChannelLogoutSessionRequired = table.Column(type: "boolean", nullable: false),
+ BackChannelLogoutUri = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
+ BackChannelLogoutSessionRequired = table.Column(type: "boolean", nullable: false),
+ AllowOfflineAccess = table.Column(type: "boolean", nullable: false),
+ IdentityTokenLifetime = table.Column(type: "integer", nullable: false),
+ AllowedIdentityTokenSigningAlgorithms = table.Column(type: "character varying(100)", maxLength: 100, nullable: true),
+ AccessTokenLifetime = table.Column(type: "integer", nullable: false),
+ AuthorizationCodeLifetime = table.Column(type: "integer", nullable: false),
+ ConsentLifetime = table.Column(type: "integer", nullable: true),
+ AbsoluteRefreshTokenLifetime = table.Column(type: "integer", nullable: false),
+ SlidingRefreshTokenLifetime = table.Column(type: "integer", nullable: false),
+ RefreshTokenUsage = table.Column(type: "integer", nullable: false),
+ UpdateAccessTokenClaimsOnRefresh = table.Column(type: "boolean", nullable: false),
+ RefreshTokenExpiration = table.Column(type: "integer", nullable: false),
+ AccessTokenType = table.Column(type: "integer", nullable: false),
+ EnableLocalLogin = table.Column(type: "boolean", nullable: false),
+ IncludeJwtId = table.Column(type: "boolean", nullable: false),
+ AlwaysSendClientClaims = table.Column(type: "boolean", nullable: false),
+ ClientClaimsPrefix = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
+ PairWiseSubjectSalt = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
+ Created = table.Column(type: "timestamp with time zone", nullable: false),
+ Updated = table.Column(type: "timestamp with time zone", nullable: true),
+ LastAccessed = table.Column(type: "timestamp with time zone", nullable: true),
+ UserSsoLifetime = table.Column(type: "integer", nullable: true),
+ UserCodeType = table.Column(type: "character varying(100)", maxLength: 100, nullable: true),
+ DeviceCodeLifetime = table.Column