Files
Govor/Govor.Domain/Configurations/E2eeRecoveryVaultConfiguration.cs
Artemy a3401ceedf 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.
2026-10-24 22:19:08 +07:00

23 lines
930 B
C#

using Govor.Domain.Models.Users;
using Govor.Domain.Models.Users.Crypto;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Govor.Domain.Configurations;
public class E2eeRecoveryVaultConfiguration : IEntityTypeConfiguration<E2eeRecoveryVault>
{
public void Configure(EntityTypeBuilder<E2eeRecoveryVault> builder)
{
builder.HasKey(v => v.UserId);
var b = builder;
b.Property(v => v.Revision).IsConcurrencyToken();
b.Property(v => v.IdentityKey).HasMaxLength(200);
b.Property(v => v.Signature).HasMaxLength(100);
b.Property(v => v.Ciphertext).HasMaxLength(4_000_000);
b.Property(v => v.PasswordCiphertext).HasMaxLength(4096);
b.Property(v => v.PasswordSignature).HasMaxLength(100);
b.HasOne<User>().WithOne().HasForeignKey<E2eeRecoveryVault>(v => v.UserId).OnDelete(DeleteBehavior.Cascade);
}
}