diff --git a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Components/Pages/Dashboard/SessionDiagnostics.razor b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Components/Pages/Dashboard/SessionDiagnostics.razor
index f94420bb..421bac74 100644
--- a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Components/Pages/Dashboard/SessionDiagnostics.razor
+++ b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Components/Pages/Dashboard/SessionDiagnostics.razor
@@ -70,7 +70,7 @@
diff --git a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/20261202180832_005_SemiHybridSessionSupport.Designer.cs b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/20261202180832_005_SemiHybridSessionSupport.Designer.cs
new file mode 100644
index 00000000..20b3abc7
--- /dev/null
+++ b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/20261202180832_005_SemiHybridSessionSupport.Designer.cs
@@ -0,0 +1,797 @@
+//
+using System;
+using CodeBeam.UltimateAuth.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace CodeBeam.UltimateAuth.IdentityLab.Migrations;
+
+[DbContext(typeof(UAuthDbContext))]
+[Migration("20261202180832_005_SemiHybridSessionSupport")]
+partial class _20261202180832_005_SemiHybridSessionSupport
+{
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "11.0.0")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authentication.EntityFrameworkCore.AuthenticationSecurityStateProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CredentialType")
+ .HasColumnType("integer");
+
+ b.Property("FailedAttempts")
+ .HasColumnType("integer");
+
+ b.Property("LastFailedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("LockedUntil")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RequiresReauthentication")
+ .HasColumnType("boolean");
+
+ b.Property("ResetAttempts")
+ .HasColumnType("integer");
+
+ b.Property("ResetConsumedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ResetExpiresAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ResetRequestedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ResetTokenHash")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)");
+
+ b.Property("Scope")
+ .HasColumnType("integer");
+
+ b.Property("SecurityVersion")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "LockedUntil");
+
+ b.HasIndex("Tenant", "ResetRequestedAt");
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.HasIndex("Tenant", "UserKey", "Scope");
+
+ var index = b.HasIndex("Tenant", "UserKey", "Scope", "CredentialType")
+ .IsUnique();
+
+ NpgsqlIndexBuilderExtensions.AreNullsDistinct(index, false);
+
+ b.ToTable("UAuth_Authentication");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.RolePermissionProjection", b =>
+ {
+ b.Property("Tenant")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("RoleId")
+ .HasColumnType("uuid");
+
+ b.Property("Permission")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Tenant", "RoleId", "Permission");
+
+ b.HasIndex("Tenant", "Permission");
+
+ b.HasIndex("Tenant", "RoleId");
+
+ b.ToTable("UAuth_RolePermissions");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.RoleProjection", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "Id")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "NormalizedName")
+ .IsUnique();
+
+ b.ToTable("UAuth_Roles");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.UserRoleProjection", b =>
+ {
+ b.Property("Tenant")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UserKey")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("RoleId")
+ .HasColumnType("uuid");
+
+ b.Property("AssignedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Tenant", "UserKey", "RoleId");
+
+ b.HasIndex("Tenant", "RoleId");
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.ToTable("UAuth_UserRoles");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore.PasswordCredentialProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("LastUsedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RevokedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SecretHash")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("uuid");
+
+ b.Property("Source")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "ExpiresAt");
+
+ b.HasIndex("Tenant", "Id")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "RevokedAt");
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.HasIndex("Tenant", "UserKey", "DeletedAt");
+
+ b.ToTable("UAuth_PasswordCredentials");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore.PasswordHistoryProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CredentialId")
+ .HasColumnType("uuid");
+
+ b.Property("ReplacedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SecretHash")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.HasIndex("Tenant", "CredentialId", "ReplacedAt", "Id");
+
+ b.ToTable("UAuth_PasswordHistory");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionChainProjection", b =>
+ {
+ var id = b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(id);
+
+ b.Property("AbsoluteExpiresAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ActiveSessionId")
+ .HasColumnType("text");
+
+ b.Property("ChainId")
+ .HasColumnType("uuid");
+
+ b.Property("ClaimsSnapshot")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Device")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("DeviceId")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("character varying(64)");
+
+ b.Property("LastSeenAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RevokedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RootId")
+ .HasColumnType("uuid");
+
+ b.Property("RotationCount")
+ .HasColumnType("integer");
+
+ b.Property("SecurityVersionAtCreation")
+ .HasColumnType("bigint");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("TouchCount")
+ .HasColumnType("integer");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "ChainId")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "RootId");
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.HasIndex("Tenant", "UserKey", "DeviceId");
+
+ b.ToTable("UAuth_SessionChains");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionProjection", b =>
+ {
+ var id = b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(id);
+
+ b.Property("ChainId")
+ .HasColumnType("uuid");
+
+ b.Property("Claims")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CredentialPurpose")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasDefaultValue(0);
+
+ b.Property("Device")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Metadata")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("RevokedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SecurityVersionAtCreation")
+ .HasColumnType("bigint");
+
+ b.Property("SessionId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "ChainId");
+
+ b.HasIndex("Tenant", "ExpiresAt");
+
+ b.HasIndex("Tenant", "RevokedAt");
+
+ b.HasIndex("Tenant", "SessionId")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "ChainId", "RevokedAt");
+
+ b.HasIndex("Tenant", "UserKey", "RevokedAt");
+
+ b.ToTable("UAuth_Sessions");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionRootProjection", b =>
+ {
+ var id = b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(id);
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RevokedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RootId")
+ .HasMaxLength(128)
+ .HasColumnType("uuid");
+
+ b.Property("SecurityVersion")
+ .HasColumnType("bigint");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "RootId")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.HasIndex("Tenant", "UserKey", "RevokedAt");
+
+ b.ToTable("UAuth_SessionRoots");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Tokens.EntityFrameworkCore.RefreshTokenProjection", b =>
+ {
+ var id = b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(id);
+
+ b.Property("AuthenticatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DeviceId")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RefreshChainId")
+ .HasColumnType("uuid");
+
+ b.Property("ReplacedByTokenHash")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("RevokedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SessionChainId")
+ .HasColumnType("uuid");
+
+ b.Property("SessionId")
+ .HasColumnType("text");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("TokenHash")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("TokenId")
+ .HasColumnType("uuid");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "ExpiresAt");
+
+ b.HasIndex("Tenant", "RefreshChainId");
+
+ b.HasIndex("Tenant", "ReplacedByTokenHash");
+
+ b.HasIndex("Tenant", "SessionChainId");
+
+ b.HasIndex("Tenant", "SessionId");
+
+ b.HasIndex("Tenant", "TokenHash")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "TokenId");
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.HasIndex("Tenant", "ExpiresAt", "RevokedAt");
+
+ b.HasIndex("Tenant", "TokenHash", "RevokedAt");
+
+ b.HasIndex("Tenant", "UserKey", "DeviceId");
+
+ b.ToTable("UAuth_RefreshTokens");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Users.EntityFrameworkCore.UserIdentifierProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IsPrimary")
+ .HasColumnType("boolean");
+
+ b.Property("NormalizedValue")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Type")
+ .HasColumnType("integer");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("VerifiedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "NormalizedValue");
+
+ b.HasIndex("Tenant", "UserKey");
+
+ b.HasIndex("Tenant", "Type", "NormalizedValue")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "UserKey", "IsPrimary");
+
+ b.HasIndex("Tenant", "UserKey", "Type", "IsPrimary", "DeletedAt", "CreatedAt", "Id");
+
+ b.ToTable("UAuth_UserIdentifiers");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Users.EntityFrameworkCore.UserLifecycleProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SecurityVersion")
+ .HasColumnType("bigint");
+
+ b.Property("Status")
+ .HasColumnType("integer");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "UserKey")
+ .IsUnique();
+
+ b.HasIndex("Tenant", "DeletedAt", "CreatedAt", "Id");
+
+ b.HasIndex("Tenant", "Status", "DeletedAt", "CreatedAt", "Id");
+
+ b.ToTable("UAuth_UserLifecycles");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Users.EntityFrameworkCore.UserProfileProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Bio")
+ .HasMaxLength(4096)
+ .HasColumnType("character varying(4096)");
+
+ b.Property("BirthDate")
+ .HasColumnType("date");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Culture")
+ .HasMaxLength(64)
+ .HasColumnType("character varying(64)");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DisplayName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("FirstName")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Gender")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Language")
+ .HasMaxLength(64)
+ .HasColumnType("character varying(64)");
+
+ b.Property("LastName")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Metadata")
+ .HasColumnType("text");
+
+ b.Property("ProfileKey")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("character varying(64)");
+
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("TimeZone")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Tenant", "UserKey", "ProfileKey")
+ .IsUnique();
+
+ b.ToTable("UAuth_UserProfiles");
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionChainProjection", b =>
+ {
+ b.HasOne("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionRootProjection", null)
+ .WithMany()
+ .HasForeignKey("Tenant", "RootId")
+ .HasPrincipalKey("Tenant", "RootId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionProjection", b =>
+ {
+ b.HasOne("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionChainProjection", null)
+ .WithMany()
+ .HasForeignKey("Tenant", "ChainId")
+ .HasPrincipalKey("Tenant", "ChainId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+ });
+#pragma warning restore 612, 618
+ }
+}
diff --git a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/20261202180832_005_SemiHybridSessionSupport.cs b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/20261202180832_005_SemiHybridSessionSupport.cs
new file mode 100644
index 00000000..3e33b905
--- /dev/null
+++ b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/20261202180832_005_SemiHybridSessionSupport.cs
@@ -0,0 +1,28 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace CodeBeam.UltimateAuth.IdentityLab.Migrations;
+
+///
+public partial class _20261202180832_005_SemiHybridSessionSupport : Migration
+{
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "CredentialPurpose",
+ table: "UAuth_Sessions",
+ type: "integer",
+ nullable: false,
+ defaultValue: 0);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "CredentialPurpose",
+ table: "UAuth_Sessions");
+ }
+}
diff --git a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/UAuthDbContextModelSnapshot.cs b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/UAuthDbContextModelSnapshot.cs
index 89a7e14a..7edbd686 100644
--- a/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/UAuthDbContextModelSnapshot.cs
+++ b/apps/identity-lab/CodeBeam.UltimateAuth.IdentityLab/Migrations/UAuthDbContextModelSnapshot.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using CodeBeam.UltimateAuth.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
@@ -8,783 +8,792 @@
#nullable disable
-namespace CodeBeam.UltimateAuth.IdentityLab.Migrations
+namespace CodeBeam.UltimateAuth.IdentityLab.Migrations;
+
+[DbContext(typeof(UAuthDbContext))]
+partial class UAuthDbContextModelSnapshot : ModelSnapshot
{
- [DbContext(typeof(UAuthDbContext))]
- partial class UAuthDbContextModelSnapshot : ModelSnapshot
+ // If you encounter a merge conflict in the line below, it means you need to
+ // discard one of the migration branches and recreate its migrations on top of
+ // the other branch. See https://aka.ms/efcore-docs-migrations-conflicts for more info.
+ public override string LastMigrationId => "20261202180832_005_SemiHybridSessionSupport";
+
+ protected override void BuildModel(ModelBuilder modelBuilder)
{
- protected override void BuildModel(ModelBuilder modelBuilder)
- {
#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "10.0.14")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
+ modelBuilder
+ .HasAnnotation("ProductVersion", "11.0.0")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authentication.EntityFrameworkCore.AuthenticationSecurityStateProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- modelBuilder.Entity("CodeBeam.UltimateAuth.Authentication.EntityFrameworkCore.AuthenticationSecurityStateProjection", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ b.Property("CredentialType")
+ .HasColumnType("integer");
- b.Property("CredentialType")
- .HasColumnType("integer");
+ b.Property("FailedAttempts")
+ .HasColumnType("integer");
- b.Property("FailedAttempts")
- .HasColumnType("integer");
+ b.Property("LastFailedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("LastFailedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("LockedUntil")
+ .HasColumnType("timestamp with time zone");
- b.Property("LockedUntil")
- .HasColumnType("timestamp with time zone");
+ b.Property("RequiresReauthentication")
+ .HasColumnType("boolean");
- b.Property("RequiresReauthentication")
- .HasColumnType("boolean");
+ b.Property("ResetAttempts")
+ .HasColumnType("integer");
- b.Property("ResetAttempts")
- .HasColumnType("integer");
+ b.Property("ResetConsumedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("ResetConsumedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("ResetExpiresAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("ResetExpiresAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("ResetRequestedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("ResetRequestedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("ResetTokenHash")
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)");
- b.Property("ResetTokenHash")
- .HasMaxLength(512)
- .HasColumnType("character varying(512)");
+ b.Property("Scope")
+ .HasColumnType("integer");
- b.Property("Scope")
- .HasColumnType("integer");
+ b.Property("SecurityVersion")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
- b.Property("SecurityVersion")
- .IsConcurrencyToken()
- .HasColumnType("bigint");
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("Tenant")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("UserKey")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.HasKey("Id");
- b.HasKey("Id");
+ b.HasIndex("Tenant", "LockedUntil");
- b.HasIndex("Tenant", "LockedUntil");
+ b.HasIndex("Tenant", "ResetRequestedAt");
- b.HasIndex("Tenant", "ResetRequestedAt");
+ b.HasIndex("Tenant", "UserKey");
- b.HasIndex("Tenant", "UserKey");
+ b.HasIndex("Tenant", "UserKey", "Scope");
- b.HasIndex("Tenant", "UserKey", "Scope");
+ var index = b.HasIndex("Tenant", "UserKey", "Scope", "CredentialType")
+ .IsUnique();
- b.HasIndex("Tenant", "UserKey", "Scope", "CredentialType")
- .IsUnique();
+ NpgsqlIndexBuilderExtensions.AreNullsDistinct(index, false);
- NpgsqlIndexBuilderExtensions.AreNullsDistinct(b.HasIndex("Tenant", "UserKey", "Scope", "CredentialType"), false);
+ b.ToTable("UAuth_Authentication");
+ });
- b.ToTable("UAuth_Authentication", (string)null);
- });
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.RolePermissionProjection", b =>
+ {
+ b.Property("Tenant")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.RolePermissionProjection", b =>
- {
- b.Property("Tenant")
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("RoleId")
+ .HasColumnType("uuid");
- b.Property("RoleId")
- .HasColumnType("uuid");
+ b.Property("Permission")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property("Permission")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.HasKey("Tenant", "RoleId", "Permission");
- b.HasKey("Tenant", "RoleId", "Permission");
+ b.HasIndex("Tenant", "Permission");
- b.HasIndex("Tenant", "Permission");
+ b.HasIndex("Tenant", "RoleId");
- b.HasIndex("Tenant", "RoleId");
+ b.ToTable("UAuth_RolePermissions");
+ });
- b.ToTable("UAuth_RolePermissions", (string)null);
- });
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.RoleProjection", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uuid");
- modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.RoleProjection", b =>
- {
- b.Property("Id")
- .HasColumnType("uuid");
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("DeletedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("Tenant")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
- b.Property("Version")
- .IsConcurrencyToken()
- .HasColumnType("bigint");
+ b.HasKey("Id");
- b.HasKey("Id");
+ b.HasIndex("Tenant", "Id")
+ .IsUnique();
- b.HasIndex("Tenant", "Id")
- .IsUnique();
+ b.HasIndex("Tenant", "NormalizedName")
+ .IsUnique();
- b.HasIndex("Tenant", "NormalizedName")
- .IsUnique();
+ b.ToTable("UAuth_Roles");
+ });
- b.ToTable("UAuth_Roles", (string)null);
- });
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.UserRoleProjection", b =>
+ {
+ b.Property("Tenant")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- modelBuilder.Entity("CodeBeam.UltimateAuth.Authorization.EntityFrameworkCore.UserRoleProjection", b =>
- {
- b.Property("Tenant")
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("UserKey")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("UserKey")
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("RoleId")
+ .HasColumnType("uuid");
- b.Property("RoleId")
- .HasColumnType("uuid");
+ b.Property("AssignedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("AssignedAt")
- .HasColumnType("timestamp with time zone");
+ b.HasKey("Tenant", "UserKey", "RoleId");
- b.HasKey("Tenant", "UserKey", "RoleId");
+ b.HasIndex("Tenant", "RoleId");
- b.HasIndex("Tenant", "RoleId");
+ b.HasIndex("Tenant", "UserKey");
- b.HasIndex("Tenant", "UserKey");
+ b.ToTable("UAuth_UserRoles");
+ });
- b.ToTable("UAuth_UserRoles", (string)null);
- });
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore.PasswordCredentialProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- modelBuilder.Entity("CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore.PasswordCredentialProjection", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("DeletedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("ExpiresAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("ExpiresAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("LastUsedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("LastUsedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("RevokedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("RevokedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("SecretHash")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)");
- b.Property("SecretHash")
- .IsRequired()
- .HasMaxLength(512)
- .HasColumnType("character varying(512)");
+ b.Property("SecurityStamp")
+ .HasColumnType("uuid");
- b.Property("SecurityStamp")
- .HasColumnType("uuid");
+ b.Property("Source")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("Source")
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("Tenant")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("UserKey")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .HasColumnType("bigint");
- b.Property("Version")
- .IsConcurrencyToken()
- .HasColumnType("bigint");
+ b.HasKey("Id");
- b.HasKey("Id");
+ b.HasIndex("Tenant", "ExpiresAt");
- b.HasIndex("Tenant", "ExpiresAt");
+ b.HasIndex("Tenant", "Id")
+ .IsUnique();
- b.HasIndex("Tenant", "Id")
- .IsUnique();
+ b.HasIndex("Tenant", "RevokedAt");
- b.HasIndex("Tenant", "RevokedAt");
+ b.HasIndex("Tenant", "UserKey");
- b.HasIndex("Tenant", "UserKey");
+ b.HasIndex("Tenant", "UserKey", "DeletedAt");
- b.HasIndex("Tenant", "UserKey", "DeletedAt");
+ b.ToTable("UAuth_PasswordCredentials");
+ });
- b.ToTable("UAuth_PasswordCredentials", (string)null);
- });
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore.PasswordHistoryProjection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- modelBuilder.Entity("CodeBeam.UltimateAuth.Credentials.EntityFrameworkCore.PasswordHistoryProjection", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ b.Property("CredentialId")
+ .HasColumnType("uuid");
- b.Property("CredentialId")
- .HasColumnType("uuid");
+ b.Property("ReplacedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("ReplacedAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("SecretHash")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)");
- b.Property("SecretHash")
- .IsRequired()
- .HasMaxLength(512)
- .HasColumnType("character varying(512)");
+ b.Property("Tenant")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("Tenant")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.Property("UserKey")
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
- b.Property("UserKey")
- .IsRequired()
- .HasMaxLength(128)
- .HasColumnType("character varying(128)");
+ b.HasKey("Id");
- b.HasKey("Id");
+ b.HasIndex("Tenant", "UserKey");
- b.HasIndex("Tenant", "UserKey");
+ b.HasIndex("Tenant", "CredentialId", "ReplacedAt", "Id");
- b.HasIndex("Tenant", "CredentialId", "ReplacedAt", "Id");
+ b.ToTable("UAuth_PasswordHistory");
+ });
- b.ToTable("UAuth_PasswordHistory", (string)null);
- });
+ modelBuilder.Entity("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionChainProjection", b =>
+ {
+ var id = b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
- modelBuilder.Entity("CodeBeam.UltimateAuth.Sessions.EntityFrameworkCore.SessionChainProjection", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("bigint");
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(id);
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+ b.Property("AbsoluteExpiresAt")
+ .HasColumnType("timestamp with time zone");
- b.Property("AbsoluteExpiresAt")
- .HasColumnType("timestamp with time zone");
+ b.Property("ActiveSessionId")
+ .HasColumnType("text");
- b.Property("ActiveSessionId")
- .HasColumnType("text");
+ b.Property("ChainId")
+ .HasColumnType("uuid");
- b.Property("ChainId")
- .HasColumnType("uuid");
+ b.Property("ClaimsSnapshot")
+ .IsRequired()
+ .HasColumnType("text");
- b.Property("ClaimsSnapshot")
- .IsRequired()
- .HasColumnType("text");
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
- b.Property