Add SRP password recovery and E2EE reset

Add proof-based password registration, login, enrollment, and change flows, with rate limiting and encrypted recovery-key envelopes. Support explicit E2EE identity resets while preserving historical signer verification, and document and test the new recovery workflows.
This commit is contained in:
Artemy
2026-10-24 22:19:08 +07:00
parent 55cc9538f7
commit a3401ceedf
29 changed files with 4322 additions and 36 deletions
+9
View File
@@ -15,6 +15,7 @@ public class GovorDbContext(DbContextOptions<GovorDbContext> options) : DbContex
public virtual DbSet<UserPushToken> UserPushTokens { get; set; }
public virtual DbSet<UserCryptoSession> UserCryptoSessions { get; set; }
public virtual DbSet<E2eeRecoveryVault> E2eeRecoveryVaults { get; set; }
public DbSet<E2eeIdentityChange> E2eeIdentityChanges { get; set; }
public virtual DbSet<SignedPreKey> SignedPreKeys { get; set; }
public virtual DbSet<OneTimePreKey> OneTimePreKeys { get; set; }
public virtual DbSet<Friendship> Friendships { get; set; }
@@ -42,6 +43,14 @@ public class GovorDbContext(DbContextOptions<GovorDbContext> options) : DbContex
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<E2eeIdentityChange>(b =>
{
b.HasKey(c => new { c.UserId, c.Epoch });
b.Property(c => c.PreviousIdentityKey).HasMaxLength(200);
b.Property(c => c.IdentityKey).HasMaxLength(200);
b.Property(c => c.PreviousDeviceKeyJson).HasMaxLength(10000);
b.HasOne<User>().WithMany().HasForeignKey(c => c.UserId).OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.ApplyConfiguration(new E2eeRecoveryVaultConfiguration());
modelBuilder.ApplyConfiguration(new UserSessionConfiguration());
modelBuilder.ApplyConfiguration(new FriendshipConfiguration());