mirror of
https://github.com/Govor-team/Govor.git
synced 2026-11-16 20:56:03 +00:00
a3401ceedf
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.
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using Govor.Domain.Models.Users;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace Govor.Domain.Configurations;
|
|
|
|
public class UserConfiguration : IEntityTypeConfiguration<User>
|
|
{
|
|
public void Configure(EntityTypeBuilder<User> builder)
|
|
{
|
|
builder.HasKey(x => x.Id);
|
|
builder.Property(u => u.SrpSalt).HasMaxLength(64);
|
|
builder.Property(u => u.SrpIdentity).HasMaxLength(64);
|
|
builder.Property(u => u.SrpVerifier).HasMaxLength(1024);
|
|
builder.Property(u => u.CredentialVersion).IsConcurrencyToken();
|
|
|
|
builder.HasIndex(u => u.Username).IsUnique();
|
|
builder.HasIndex(u => u.CreatedOn);
|
|
builder.HasIndex(u => u.WasOnline);
|
|
|
|
builder.HasOne(u => u.Invite)
|
|
.WithMany(i => i.Users)
|
|
.HasForeignKey(u => u.InviteId);
|
|
|
|
builder.Property(u => u.Username)
|
|
.IsRequired()
|
|
.HasMaxLength(50);
|
|
|
|
builder.HasIndex(u => u.Username).IsUnique();
|
|
|
|
builder.Property(u => u.Description)
|
|
.HasMaxLength(500)
|
|
.IsRequired(false);
|
|
|
|
builder.Property(u => u.PasswordHash)
|
|
.IsRequired()
|
|
.HasMaxLength(128);
|
|
}
|
|
}
|