mirror of
https://github.com/Govor-team/Govor.git
synced 2026-11-17 12:59:25 +00:00
Add E2EE recovery and device rotation
Add signed, encrypted recovery archives with revision checks, account-certified device enrollment and key rotation, and historical signer lookup. Include the database migration, API endpoints, tests, and updated E2EE documentation.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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.HasOne<User>().WithOne().HasForeignKey<E2eeRecoveryVault>(v => v.UserId).OnDelete(DeleteBehavior.Cascade);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user