feat: establish dotnet engineering foundation

This commit is contained in:
2026-07-27 15:00:14 +08:00
parent 60a376ea0b
commit 28e9a9fa41
36 changed files with 17301 additions and 89 deletions

View File

@@ -32,10 +32,14 @@ internal sealed class TenantSecretConfiguration : IEntityTypeConfiguration<Tenan
builder.Property(entity => entity.SecretKey).HasMaxLength(120);
builder.Property(entity => entity.SecretRef).HasMaxLength(300);
builder.Property(entity => entity.Status).HasSnakeCaseEnum();
builder.Property(entity => entity.SecretPayload).IsJson("{}");
builder.Property(entity => entity.EncryptionKeyId).HasMaxLength(100);
builder.HasIndex(entity => new { entity.TenantId, entity.SecretRef }).IsUnique();
builder.HasIndex(entity => new { entity.TenantId, entity.Purpose, entity.Provider, entity.SecretKey }).IsUnique();
builder.HasIndex(entity => new { entity.TenantId, entity.Purpose, entity.Provider, entity.Status });
builder.ToTable(table => table.HasCheckConstraint(
"ck_tenant_secrets_encryption_envelope",
"octet_length(encrypted_payload) > 0 and octet_length(encryption_nonce) = 12 and " +
"octet_length(encryption_tag) = 16 and encryption_key_id <> ''"));
}
}