Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add shared manifest delete path (#2159)
Leendert de Borstf60b1ea44ce9
diff --git a/apps/browser-extension/src/entrypoints/popup/components/AlertMessage.tsx b/apps/browser-extension/src/entrypoints/popup/components/AlertMessage.tsxindex 09c1b369c..d24dcba5a 100644--- a/apps/browser-extension/src/entrypoints/popup/components/AlertMessage.tsx+++ b/apps/browser-extension/src/entrypoints/popup/components/AlertMessage.tsx@@ -1,4 +1,4 @@-import React from 'react';+import React, { useEffect, useRef } from 'react';export type AlertType = 'error' | 'success' | 'warning' | 'info';@@ -17,6 +17,13 @@ interface IAlertMessageProps {* @returns The rendered alert message component.*/const AlertMessage: React.FC<IAlertMessageProps> = ({ type, message, className = '' }) => {+ const alertRef = useRef<HTMLDivElement>(null);++ // A message that appears outside the visible part of a scrolled page would otherwise go unnoticed.+ useEffect(() => {+ alertRef.current?.scrollIntoView?.({ behavior: 'smooth', block: 'start' });+ }, [message]);+/*** Get the appropriate CSS classes based on alert type.* @returns CSS class string.@@ -39,7 +46,7 @@ const AlertMessage: React.FC<IAlertMessageProps> = ({ type, message, className =};return (- <div className={`${getAlertClasses()} ${className}`}>+ <div ref={alertRef} className={`${getAlertClasses()} scroll-mt-16 ${className}`}>{message}</div>);diff --git a/apps/browser-extension/src/utils/dist/core/models/webapi/index.d.ts b/apps/browser-extension/src/utils/dist/core/models/webapi/index.d.tsindex 51dc8938c..615507eac 100644--- a/apps/browser-extension/src/utils/dist/core/models/webapi/index.d.ts+++ b/apps/browser-extension/src/utils/dist/core/models/webapi/index.d.ts@@ -399,6 +399,14 @@ declare enum AuthEventType {* Represents a user registration event.*/Register = 30,+ /**+ * Represents creation of a shared vault.+ */+ SharedVaultCreation = 50,+ /**+ * Represents deletion of a shared vault, confirmed with the master password.+ */+ SharedVaultDeletion = 51,/*** Represents a user account deletion event.*/@@ -625,6 +633,23 @@ type GrantManifestAccessRequest = {type GrantManifestAccessResponse = {invitationId: string;};+/**+ * The SRP handshake served by POST /v2/Groups/{groupId}/manifests/{manifestId}/delete/initiate.+ */+type DeleteSharedManifestInitiateResponse = {+ salt: string;+ serverEphemeral: string;+ encryptionType: string;+ encryptionSettings: string;+ srpIdentity: string;+};+/**+ * Delete a shared vault for good, carrying the SRP proof of the caller's master password.+ */+type DeleteSharedManifestRequest = {+ clientPublicEphemeral: string;+ clientSessionProof: string;+};/*** The capability keys the server resolves and hands to clients on the status response.@@ -649,4 +674,4 @@ type CapabilityKey = typeof CapabilityKeys[keyof typeof CapabilityKeys];*/declare function isCapabilityEnabled(value: string | undefined): boolean;-export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };+export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type DeleteSharedManifestInitiateResponse, type DeleteSharedManifestRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };diff --git a/apps/browser-extension/src/utils/dist/core/models/webapi/index.js b/apps/browser-extension/src/utils/dist/core/models/webapi/index.jsindex a9f38eb42..5c820840b 100644--- a/apps/browser-extension/src/utils/dist/core/models/webapi/index.js+++ b/apps/browser-extension/src/utils/dist/core/models/webapi/index.js@@ -14,6 +14,8 @@ var AuthEventType = /* @__PURE__ */ ((AuthEventType2) => {AuthEventType2[AuthEventType2["TwoFactorAuthEnable"] = 22] = "TwoFactorAuthEnable";AuthEventType2[AuthEventType2["TwoFactorAuthDisable"] = 23] = "TwoFactorAuthDisable";AuthEventType2[AuthEventType2["Register"] = 30] = "Register";+ AuthEventType2[AuthEventType2["SharedVaultCreation"] = 50] = "SharedVaultCreation";+ AuthEventType2[AuthEventType2["SharedVaultDeletion"] = 51] = "SharedVaultDeletion";AuthEventType2[AuthEventType2["AccountDeletion"] = 99] = "AccountDeletion";return AuthEventType2;})(AuthEventType || {});diff --git a/apps/mobile-app/utils/dist/core/models/webapi/index.d.ts b/apps/mobile-app/utils/dist/core/models/webapi/index.d.tsindex 51dc8938c..615507eac 100644--- a/apps/mobile-app/utils/dist/core/models/webapi/index.d.ts+++ b/apps/mobile-app/utils/dist/core/models/webapi/index.d.ts@@ -399,6 +399,14 @@ declare enum AuthEventType {* Represents a user registration event.*/Register = 30,+ /**+ * Represents creation of a shared vault.+ */+ SharedVaultCreation = 50,+ /**+ * Represents deletion of a shared vault, confirmed with the master password.+ */+ SharedVaultDeletion = 51,/*** Represents a user account deletion event.*/@@ -625,6 +633,23 @@ type GrantManifestAccessRequest = {type GrantManifestAccessResponse = {invitationId: string;};+/**+ * The SRP handshake served by POST /v2/Groups/{groupId}/manifests/{manifestId}/delete/initiate.+ */+type DeleteSharedManifestInitiateResponse = {+ salt: string;+ serverEphemeral: string;+ encryptionType: string;+ encryptionSettings: string;+ srpIdentity: string;+};+/**+ * Delete a shared vault for good, carrying the SRP proof of the caller's master password.+ */+type DeleteSharedManifestRequest = {+ clientPublicEphemeral: string;+ clientSessionProof: string;+};/*** The capability keys the server resolves and hands to clients on the status response.@@ -649,4 +674,4 @@ type CapabilityKey = typeof CapabilityKeys[keyof typeof CapabilityKeys];*/declare function isCapabilityEnabled(value: string | undefined): boolean;-export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };+export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type DeleteSharedManifestInitiateResponse, type DeleteSharedManifestRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };diff --git a/apps/mobile-app/utils/dist/core/models/webapi/index.js b/apps/mobile-app/utils/dist/core/models/webapi/index.jsindex a9f38eb42..5c820840b 100644--- a/apps/mobile-app/utils/dist/core/models/webapi/index.js+++ b/apps/mobile-app/utils/dist/core/models/webapi/index.js@@ -14,6 +14,8 @@ var AuthEventType = /* @__PURE__ */ ((AuthEventType2) => {AuthEventType2[AuthEventType2["TwoFactorAuthEnable"] = 22] = "TwoFactorAuthEnable";AuthEventType2[AuthEventType2["TwoFactorAuthDisable"] = 23] = "TwoFactorAuthDisable";AuthEventType2[AuthEventType2["Register"] = 30] = "Register";+ AuthEventType2[AuthEventType2["SharedVaultCreation"] = 50] = "SharedVaultCreation";+ AuthEventType2[AuthEventType2["SharedVaultDeletion"] = 51] = "SharedVaultDeletion";AuthEventType2[AuthEventType2["AccountDeletion"] = 99] = "AccountDeletion";return AuthEventType2;})(AuthEventType || {});diff --git a/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs b/apps/server/AliasVault.Api/Controllers/V2/GroupsController.csindex 68b105855..588a03793 100644--- a/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs+++ b/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs@@ -11,8 +11,11 @@ using AliasServerDb;using AliasVault.Api.Controllers.Abstracts;using AliasVault.Api.Filters;using AliasVault.Api.Helpers;+using AliasVault.Auth;+using AliasVault.Cryptography.Client;using AliasVault.Shared.Models.Enums;using AliasVault.Shared.Models.WebApi;+using AliasVault.Shared.Models.WebApi.V1.Auth;using AliasVault.Shared.Models.WebApi.V2.Groups;using AliasVault.Shared.Providers.Time;using AliasVault.Shared.Server.Capabilities;@@ -20,6 +23,7 @@ using Asp.Versioning;using Microsoft.AspNetCore.Identity;using Microsoft.AspNetCore.Mvc;using Microsoft.EntityFrameworkCore;+using Microsoft.Extensions.Caching.Memory;/// <summary>/// Groups controller which manages the shared vaults of a group and who inside the group can open them.@@ -27,8 +31,10 @@ using Microsoft.EntityFrameworkCore;/// <param name="dbContextFactory">The database context factory.</param>/// <param name="userManager">The user manager.</param>/// <param name="timeProvider">Time provider.</param>+/// <param name="cache">Memory cache holding the server's SRP ephemeral between the delete initiate and confirm calls.</param>+/// <param name="authLoggingService">Auth logging service, recording shared vault creation and the master password checks guarding deletion.</param>[ApiVersion("2")]-public class GroupsController(IAliasServerDbContextFactory dbContextFactory, UserManager<AliasVaultUser> userManager, ITimeProvider timeProvider) : AuthenticatedRequestController(userManager)+public class GroupsController(IAliasServerDbContextFactory dbContextFactory, UserManager<AliasVaultUser> userManager, ITimeProvider timeProvider, IMemoryCache cache, AuthLoggingService authLoggingService) : AuthenticatedRequestController(userManager){private const string ManifestFormat = "manifest-v1";@@ -198,6 +204,8 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Usereturn BadRequest(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.MANIFEST_ID_TAKEN, 400));}+ await authLoggingService.LogAuthEventSuccessAsync(me.UserName!, AuthEventType.SharedVaultCreation);+return Ok(new CreateSharedManifestResponse { ManifestId = manifest.ManifestId, RevisionNumber = manifest.RevisionNumber });}@@ -359,6 +367,119 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Usereturn Ok();}+ /// <summary>+ /// Begin deleting one of the group's shared vaults.+ /// </summary>+ /// <param name="groupId">The group ID.</param>+ /// <param name="manifestId">The shared vault to delete.</param>+ /// <returns>The SRP handshake values for the confirm endpoint.</returns>+ [HttpPost("{groupId:guid}/manifests/{manifestId:guid}/delete/initiate")]+ public async Task<IActionResult> InitiateDeleteManifest(Guid groupId, Guid manifestId)+ {+ await using var context = await dbContextFactory.CreateDbContextAsync();+ var me = await GetCurrentUserAsync();+ if (me == null)+ {+ return Unauthorized();+ }++ if (!await GroupHelper.IsSharedGroupAdminAsync(context, groupId, me.Id))+ {+ return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.GROUP_NOT_FOUND, 404));+ }++ if (!await context.VaultManifests.AnyAsync(m => m.ManifestId == manifestId && m.OwnerGroupId == groupId))+ {+ return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.SHARED_MANIFEST_NOT_FOUND, 404));+ }++ var latestVaultEncryptionSettings = await AuthHelper.GetUserLatestVaultEncryptionSettingsAsync(context, me);+ var srpIdentity = me.SrpIdentity ?? me.UserName!.ToLowerInvariant();+ var ephemeral = Srp.GenerateEphemeralServer(latestVaultEncryptionSettings.Verifier);+ cache.Set(AuthHelper.CachePrefixEphemeral + srpIdentity, ephemeral.Secret, TimeSpan.FromMinutes(5));++ return Ok(new LoginInitiateResponse(+ latestVaultEncryptionSettings.Salt,+ ephemeral.Public,+ latestVaultEncryptionSettings.EncryptionType,+ latestVaultEncryptionSettings.EncryptionSettings,+ srpIdentity));+ }++ /// <summary>+ /// Delete one of the group's shared vaults (confirmed with the master password).+ /// </summary>+ /// <param name="groupId">The group ID.</param>+ /// <param name="manifestId">The shared vault to delete.</param>+ /// <param name="model">The SRP proof of the caller's master password.</param>+ /// <returns>Ok on success.</returns>+ [HttpPost("{groupId:guid}/manifests/{manifestId:guid}/delete/confirm")]+ public async Task<IActionResult> ConfirmDeleteManifest(Guid groupId, Guid manifestId, [FromBody] DeleteSharedManifestRequest model)+ {+ await using var context = await dbContextFactory.CreateDbContextAsync();+ var me = await GetCurrentUserAsync();+ if (me == null)+ {+ return Unauthorized();+ }++ if (!await GroupHelper.IsSharedGroupAdminAsync(context, groupId, me.Id))+ {+ return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.GROUP_NOT_FOUND, 404));+ }++ var manifest = await context.VaultManifests.FirstOrDefaultAsync(m => m.ManifestId == manifestId && m.OwnerGroupId == groupId);+ if (manifest == null)+ {+ return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.SHARED_MANIFEST_NOT_FOUND, 404));+ }++ // Validate the SRP session (actual password check).+ var (serverSession, activeSessionFound) = await AuthHelper.ValidateSrpSessionAsync(cache, context, me, model.ClientPublicEphemeral, model.ClientSessionProof);+ if (serverSession is null)+ {+ await authLoggingService.LogAuthEventFailAsync(me.UserName!, AuthEventType.SharedVaultDeletion, activeSessionFound ? AuthFailureReason.InvalidPassword : AuthFailureReason.SrpSessionNotFound);+ return BadRequest(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.PASSWORD_MISMATCH, 400));+ }++ await authLoggingService.LogAuthEventSuccessAsync(me.UserName!, AuthEventType.SharedVaultDeletion);++ var strategy = context.Database.CreateExecutionStrategy();+ await strategy.ExecuteAsync(async () =>+ {+ await using var transaction = await context.Database.BeginTransactionAsync();++ // Close any open invite.+ foreach (var invitation in await context.GroupInvitations.Where(i => i.VaultManifestId == manifestId && i.State == GroupInvitationState.Pending).ToListAsync())+ {+ CloseInvitation(invitation, GroupInvitationState.Revoked);+ }++ // Delete any active grant.+ var holders = await context.VaultManifestAccessKeys+ .Where(k => k.VaultManifestId == manifestId && k.Type == ManifestKeyType.GrantKey)+ .Select(k => k.UserId)+ .Distinct()+ .ToListAsync();+ foreach (var holder in holders)+ {+ await GrantHelper.RevokeAccessAsync(context, manifestId, holder);+ }++ await context.SaveChangesAsync();++ // Key rows and queued client actions reference the manifest without a cascading foreign key, so leftovers are deleted explicitly.+ await context.VaultManifestAccessKeys.Where(k => k.VaultManifestId == manifestId).ExecuteDeleteAsync();+ await context.ClientActions.Where(a => a.ManifestId == manifestId).ExecuteDeleteAsync();+ context.VaultManifests.Remove(manifest);++ await context.SaveChangesAsync();+ await transaction.CommitAsync();+ });++ return Ok();+ }+/// <summary>/// Accept an offer of access addressed to the current user./// </summary>diff --git a/apps/server/Databases/AliasServerDb/AuthLog.cs b/apps/server/Databases/AliasServerDb/AuthLog.csindex 14590d599..d1a745213 100644--- a/apps/server/Databases/AliasServerDb/AuthLog.cs+++ b/apps/server/Databases/AliasServerDb/AuthLog.cs@@ -89,6 +89,16 @@ public enum AuthFailureReason[Index(nameof(Username), nameof(IsSuccess), nameof(Timestamp), IsDescending = new[] { false, false, true }, Name = "IX_Username_IsSuccess_Timestamp")]public class AuthLog{+ /// <summary>+ /// Maximum stored length of <see cref="RequestPath"/>.+ /// </summary>+ public const int RequestPathMaxLength = 255;++ /// <summary>+ /// Maximum stored length of <see cref="Client"/>.+ /// </summary>+ public const int ClientMaxLength = 100;+/// <summary>/// Gets or sets the unique identifier for the authentication log entry./// </summary>@@ -165,7 +175,7 @@ public class AuthLog/// <summary>/// Gets or sets the request path of the authentication event./// </summary>- [MaxLength(100)]+ [MaxLength(RequestPathMaxLength)]public string? RequestPath { get; set; }/// <summary>@@ -176,6 +186,6 @@ public class AuthLog/// <summary>/// Gets or sets the client application name and version./// </summary>- [MaxLength(100)]+ [MaxLength(ClientMaxLength)]public string? Client { get; set; }}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.Designer.csnew file mode 100644index 000000000..a48f783e8--- /dev/null+++ b/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.Designer.cs@@ -0,0 +1,1927 @@+// <auto-generated />+using System;+using AliasServerDb;+using Microsoft.EntityFrameworkCore;+using Microsoft.EntityFrameworkCore.Infrastructure;+using Microsoft.EntityFrameworkCore.Migrations;+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;++#nullable disable++namespace AliasServerDb.Migrations+{+ [DbContext(typeof(AliasServerDbContext))]+ [Migration("20260822141154_WidenAuthLogRequestPath")]+ partial class WidenAuthLogRequestPath+ {+ /// <inheritdoc />+ protected override void BuildTargetModel(ModelBuilder modelBuilder)+ {+#pragma warning disable 612, 618+ modelBuilder+ .HasAnnotation("ProductVersion", "10.0.10")+ .HasAnnotation("Proxies:ChangeTracking", false)+ .HasAnnotation("Proxies:CheckEquality", false)+ .HasAnnotation("Proxies:LazyLoading", true)+ .HasAnnotation("Relational:MaxIdentifierLength", 63);++ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);++ modelBuilder.Entity("AliasServerDb.AdminUser", b =>+ {+ b.Property<string>("Id")+ .HasColumnType("text");++ b.Property<int>("AccessFailedCount")+ .HasColumnType("integer");++ b.Property<string>("ConcurrencyStamp")+ .HasColumnType("text");++ b.Property<string>("Email")+ .HasColumnType("text");++ b.Property<bool>("EmailConfirmed")+ .HasColumnType("boolean");++ b.Property<DateTime?>("LastPasswordChanged")+ .HasColumnType("timestamp with time zone");++ b.Property<bool>("LockoutEnabled")+ .HasColumnType("boolean");++ b.Property<DateTimeOffset?>("LockoutEnd")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("NormalizedEmail")+ .HasColumnType("text");++ b.Property<string>("NormalizedUserName")+ .HasColumnType("text");++ b.Property<string>("PasswordHash")+ .HasColumnType("text");++ b.Property<string>("PhoneNumber")+ .HasColumnType("text");++ b.Property<bool>("PhoneNumberConfirmed")+ .HasColumnType("boolean");++ b.Property<string>("SecurityStamp")+ .HasColumnType("text");++ b.Property<bool>("TwoFactorEnabled")+ .HasColumnType("boolean");++ b.Property<string>("UserName")+ .HasColumnType("text");++ b.HasKey("Id");++ b.ToTable("AdminUsers");+ });++ modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>+ {+ b.Property<string>("Id")+ .HasColumnType("text");++ b.Property<int>("AccessFailedCount")+ .HasColumnType("integer");++ b.Property<bool>("Blocked")+ .HasColumnType("boolean");++ b.Property<DateTime?>("BlockedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("ConcurrencyStamp")+ .HasColumnType("text");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("Email")+ .HasColumnType("text");++ b.Property<bool>("EmailConfirmed")+ .HasColumnType("boolean");++ b.Property<DateTime?>("LastActivityDate")+ .HasColumnType("timestamp with time zone");++ b.Property<bool>("LockoutEnabled")+ .HasColumnType("boolean");++ b.Property<DateTimeOffset?>("LockoutEnd")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("NormalizedEmail")+ .HasColumnType("text");++ b.Property<string>("NormalizedUserName")+ .HasColumnType("text");++ b.Property<DateTime>("PasswordChangedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("PasswordHash")+ .HasColumnType("text");++ b.Property<Guid>("PersonalGroupId")+ .HasColumnType("uuid");++ b.Property<string>("PhoneNumber")+ .HasColumnType("text");++ b.Property<bool>("PhoneNumberConfirmed")+ .HasColumnType("boolean");++ b.Property<string>("SecurityStamp")+ .HasColumnType("text");++ b.Property<string>("SrpIdentity")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<bool>("TwoFactorEnabled")+ .HasColumnType("boolean");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserName")+ .HasColumnType("text");++ b.HasKey("Id");++ b.HasIndex("PersonalGroupId")+ .IsUnique()+ .HasDatabaseName("UX_AliasVaultUsers_PersonalGroupId");++ b.ToTable("AliasVaultUsers");+ });++ modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("DeviceIdentifier")+ .IsRequired()+ .HasColumnType("text");++ b.Property<DateTime>("ExpireDate")+ .HasMaxLength(255)+ .HasColumnType("timestamp with time zone");++ b.Property<string>("IpAddress")+ .HasMaxLength(45)+ .HasColumnType("character varying(45)");++ b.Property<string>("PreviousTokenValue")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("Value")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("UserId");++ b.ToTable("AliasVaultUserRefreshTokens");+ });++ modelBuilder.Entity("AliasServerDb.AuthLog", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<string>("AdditionalInfo")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("Browser")+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("Client")+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("Country")+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<string>("DeviceType")+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<int>("EventType")+ .HasColumnType("integer");++ b.Property<int?>("FailureReason")+ .HasColumnType("integer");++ b.Property<string>("IpAddress")+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<bool>("IsSuccess")+ .HasColumnType("boolean");++ b.Property<bool>("IsSuspiciousActivity")+ .HasColumnType("boolean");++ b.Property<string>("OperatingSystem")+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("RequestPath")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("Timestamp")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("Username")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex(new[] { "EventType" }, "IX_EventType");++ b.HasIndex(new[] { "IpAddress" }, "IX_IpAddress");++ b.HasIndex(new[] { "Timestamp" }, "IX_Timestamp");++ b.HasIndex(new[] { "Username", "IsSuccess", "Timestamp" }, "IX_Username_IsSuccess_Timestamp")+ .IsDescending(false, false, true);++ b.HasIndex(new[] { "Username", "Timestamp" }, "IX_Username_Timestamp")+ .IsDescending(false, true);++ b.ToTable("AuthLogs");+ });++ modelBuilder.Entity("AliasServerDb.BlockedIpRange", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<bool>("BlockLogin")+ .HasColumnType("boolean");++ b.Property<bool>("BlockRegistration")+ .HasColumnType("boolean");++ b.Property<bool>("BlockShadow")+ .HasColumnType("boolean");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("CreatedBy")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<bool>("Enabled")+ .HasColumnType("boolean");++ b.Property<string>("IpRange")+ .IsRequired()+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<string>("Reason")+ .HasMaxLength(500)+ .HasColumnType("character varying(500)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("Id");++ b.HasIndex(new[] { "Enabled" }, "IX_BlockedIpRange_Enabled");++ b.HasIndex(new[] { "IpRange" }, "IX_BlockedIpRange_IpRange")+ .IsUnique();++ b.ToTable("BlockedIpRanges");+ });++ modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<string>("CapabilityKey")+ .IsRequired()+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("ClientName")+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("CreatedBy")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime?>("EffectiveFrom")+ .HasColumnType("timestamp with time zone");++ b.Property<DateTime?>("EffectiveUntil")+ .HasColumnType("timestamp with time zone");++ b.Property<bool>("Enabled")+ .HasColumnType("boolean");++ b.Property<Guid?>("GroupId")+ .HasColumnType("uuid");++ b.Property<string>("Kind")+ .IsRequired()+ .HasMaxLength(20)+ .HasColumnType("character varying(20)");++ b.Property<string>("Notes")+ .HasMaxLength(1000)+ .HasColumnType("character varying(1000)");++ b.Property<string>("Tier")+ .HasMaxLength(20)+ .HasColumnType("character varying(20)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("Value")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("GroupId");++ b.HasIndex("Tier");++ b.HasIndex("UserId");++ b.HasIndex("CapabilityKey", "Enabled");++ b.ToTable("CapabilityRules");+ });++ modelBuilder.Entity("AliasServerDb.ClientAction", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<Guid?>("ManifestId")+ .HasColumnType("uuid");++ b.Property<string>("Payload")+ .HasColumnType("jsonb");++ b.Property<Guid?>("TargetGroupId")+ .HasColumnType("uuid");++ b.Property<string>("TargetUserId")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("Type")+ .IsRequired()+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("Id");++ b.HasIndex("TargetGroupId");++ b.HasIndex("TargetUserId");++ b.ToTable("ClientActions");+ });++ modelBuilder.Entity("AliasServerDb.Email", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<int>("AttachmentCount")+ .HasColumnType("integer");++ b.Property<DateTime>("Date")+ .HasColumnType("timestamp with time zone");++ b.Property<DateTime>("DateSystem")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("From")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("FromDomain")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("FromLocal")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("MessageHtml")+ .HasColumnType("text");++ b.Property<string>("MessagePlain")+ .HasColumnType("text");++ b.Property<string>("MessagePreview")+ .HasColumnType("text");++ b.Property<string>("MessageSource")+ .HasColumnType("text");++ b.Property<byte[]>("MessageSourceBytes")+ .HasColumnType("bytea");++ b.Property<bool>("PushNotificationSent")+ .HasColumnType("boolean");++ b.Property<string>("Subject")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("To")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("ToDomain")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("ToLocal")+ .IsRequired()+ .HasColumnType("text");++ b.Property<bool>("Visible")+ .HasColumnType("boolean");++ b.HasKey("Id");++ b.HasIndex("Date");++ b.HasIndex("DateSystem");++ b.HasIndex("PushNotificationSent");++ b.HasIndex("Visible");++ b.HasIndex("To", "DateSystem");++ b.ToTable("Emails");+ });++ modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<byte[]>("Bytes")+ .IsRequired()+ .HasColumnType("bytea");++ b.Property<DateTime>("Date")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("EmailId")+ .HasColumnType("integer");++ b.Property<string>("Filename")+ .IsRequired()+ .HasColumnType("text");++ b.Property<int>("Filesize")+ .HasColumnType("integer");++ b.Property<string>("MimeType")+ .IsRequired()+ .HasColumnType("text");++ b.HasKey("Id");++ b.HasIndex("EmailId");++ b.ToTable("EmailAttachments");+ });++ modelBuilder.Entity("AliasServerDb.EmailClaim", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<string>("Address")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("AddressDomain")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("AddressLocal")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<bool>("AnonymizedSenderCounted")+ .HasColumnType("boolean");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("Id");++ b.HasIndex("Address")+ .IsUnique();++ b.ToTable("EmailClaims");+ });++ modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>+ {+ b.Property<Guid>("EmailClaimId")+ .HasColumnType("uuid");++ b.Property<Guid>("VaultManifestId")+ .HasColumnType("uuid");++ b.Property<string>("State")+ .IsRequired()+ .HasMaxLength(20)+ .HasColumnType("character varying(20)");++ b.HasKey("EmailClaimId", "VaultManifestId");++ b.HasIndex("EmailClaimId")+ .HasDatabaseName("IX_EmailClaimLinks_EmailClaimId_Live")+ .HasFilter("\"State\" <> 'Removed'");++ b.HasIndex("VaultManifestId", "EmailClaimId");++ b.ToTable("EmailClaimLinks");+ });++ modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>+ {+ b.Property<int>("EmailId")+ .HasColumnType("integer");++ b.Property<Guid>("VaultManifestDeliveryKeyId")+ .HasColumnType("uuid");++ b.Property<string>("EncryptedSymmetricKey")+ .IsRequired()+ .HasColumnType("text");++ b.HasKey("EmailId", "VaultManifestDeliveryKeyId");++ b.HasIndex("VaultManifestDeliveryKeyId", "EmailId");++ b.ToTable("EmailDecryptionKeys");+ });++ modelBuilder.Entity("AliasServerDb.EmailPart", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<byte[]>("Bytes")+ .IsRequired()+ .HasColumnType("bytea");++ b.Property<int>("EmailId")+ .HasColumnType("integer");++ b.Property<int>("PartIndex")+ .HasColumnType("integer");++ b.HasKey("Id");++ b.HasIndex("EmailId", "PartIndex")+ .IsUnique();++ b.ToTable("EmailParts");+ });++ modelBuilder.Entity("AliasServerDb.Group", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.PrimitiveCollection<int[]>("AnonymizedEmailAliasSenderCounts")+ .IsRequired()+ .ValueGeneratedOnAdd()+ .HasColumnType("integer[]")+ .HasDefaultValueSql("array_fill(0, ARRAY[64])");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("EmailsReceived")+ .HasColumnType("integer");++ b.Property<int>("MaxEmailAgeDays")+ .HasColumnType("integer");++ b.Property<int>("MaxEmails")+ .HasColumnType("integer");++ b.Property<string>("Name")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<bool>("ShadowBlocked")+ .HasColumnType("boolean");++ b.Property<DateTime?>("ShadowBlockedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("Type")+ .HasColumnType("integer");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("Id");++ b.ToTable("Groups");+ });++ modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedName")+ .HasColumnType("text");++ b.Property<string>("EncryptedVek")+ .HasColumnType("text");++ b.Property<Guid>("GroupId")+ .HasColumnType("uuid");++ b.Property<string>("InviteeUserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("InviterUserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime?>("RespondedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("Role")+ .HasColumnType("integer");++ b.Property<string>("State")+ .IsRequired()+ .HasMaxLength(20)+ .HasColumnType("character varying(20)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<Guid?>("UserGrantKeyId")+ .HasColumnType("uuid");++ b.Property<Guid?>("VaultManifestId")+ .HasColumnType("uuid");++ b.HasKey("Id");++ b.HasIndex("GroupId");++ b.HasIndex("InviterUserId");++ b.HasIndex("UserGrantKeyId");++ b.HasIndex("InviteeUserId", "State");++ b.HasIndex("VaultManifestId", "InviteeUserId")+ .IsUnique()+ .HasDatabaseName("UX_GroupInvitations_Manifest_Invitee_Pending")+ .HasFilter("\"State\" = 'Pending'");++ b.ToTable("GroupInvitations");+ });++ modelBuilder.Entity("AliasServerDb.GroupMember", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<Guid>("GroupId")+ .HasColumnType("uuid");++ b.Property<int>("Role")+ .HasColumnType("integer");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("UserId");++ b.HasIndex("GroupId", "UserId")+ .IsUnique();++ b.ToTable("GroupMembers");+ });++ modelBuilder.Entity("AliasServerDb.Log", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<string>("Application")+ .IsRequired()+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<string>("Exception")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("Level")+ .IsRequired()+ .HasMaxLength(128)+ .HasColumnType("character varying(128)");++ b.Property<string>("LogEvent")+ .IsRequired()+ .HasColumnType("text")+ .HasColumnName("LogEvent");++ b.Property<string>("Message")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("MessageTemplate")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("Properties")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("SourceContext")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("TimeStamp")+ .HasColumnType("timestamp with time zone");++ b.HasKey("Id");++ b.HasIndex("Application");++ b.HasIndex("TimeStamp");++ b.ToTable("Logs", (string)null);+ });++ modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>+ {+ b.Property<string>("Id")+ .HasColumnType("text");++ b.Property<DateTime?>("ClearedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("ClientIpAddress")+ .HasColumnType("text");++ b.Property<string>("ClientPublicKey")+ .IsRequired()+ .HasColumnType("text");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedDecryptionKey")+ .HasColumnType("text");++ b.Property<DateTime?>("FulfilledAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("MobileIpAddress")+ .HasColumnType("text");++ b.Property<DateTime?>("RetrievedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .HasColumnType("text");++ b.HasKey("Id");++ b.HasIndex(new[] { "ClientIpAddress" }, "IX_ClientIpAddress");++ b.HasIndex(new[] { "CreatedAt" }, "IX_CreatedAt");++ b.HasIndex(new[] { "MobileIpAddress" }, "IX_MobileIpAddress");++ b.HasIndex(new[] { "RetrievedAt", "ClearedAt", "FulfilledAt" }, "IX_RetrievedAt_ClearedAt_FulfilledAt");++ b.HasIndex(new[] { "UserId" }, "IX_UserId");++ b.ToTable("MobileLoginRequests");+ });++ modelBuilder.Entity("AliasServerDb.RateLimit", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int?>("AppliesToAccountAgeMaxDays")+ .HasColumnType("integer");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("CreatedBy")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime?>("EffectiveFrom")+ .HasColumnType("timestamp with time zone");++ b.Property<DateTime?>("EffectiveUntil")+ .HasColumnType("timestamp with time zone");++ b.Property<bool>("Enabled")+ .HasColumnType("boolean");++ b.Property<Guid?>("GroupId")+ .HasColumnType("uuid");++ b.Property<int>("LimitType")+ .HasColumnType("integer");++ b.Property<int>("MaxCount")+ .HasColumnType("integer");++ b.Property<string>("Notes")+ .HasMaxLength(1000)+ .HasColumnType("character varying(1000)");++ b.Property<int?>("Tier")+ .HasColumnType("integer");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("WindowSeconds")+ .HasColumnType("integer");++ b.HasKey("Id");++ b.HasIndex("GroupId");++ b.HasIndex("Tier");++ b.HasIndex("LimitType", "Enabled");++ b.ToTable("RateLimits");+ });++ modelBuilder.Entity("AliasServerDb.ServerSetting", b =>+ {+ b.Property<string>("Key")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("Value")+ .HasColumnType("text");++ b.HasKey("Key");++ b.ToTable("ServerSettings");+ });++ modelBuilder.Entity("AliasServerDb.TaskRunnerJob", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<TimeOnly?>("EndTime")+ .HasColumnType("time without time zone");++ b.Property<string>("ErrorMessage")+ .HasColumnType("text");++ b.Property<bool>("IsOnDemand")+ .HasColumnType("boolean");++ b.Property<string>("Name")+ .IsRequired()+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<DateTime>("RunDate")+ .HasColumnType("timestamp with time zone");++ b.Property<TimeOnly>("StartTime")+ .HasColumnType("time without time zone");++ b.Property<int>("Status")+ .HasColumnType("integer");++ b.HasKey("Id");++ b.ToTable("TaskRunnerJobs");+ });++ modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int>("AccountKeyVersion")+ .HasColumnType("integer");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedPrivateKey")+ .IsRequired()+ .HasMaxLength(4000)+ .HasColumnType("character varying(4000)");++ b.Property<bool>("IsPrimary")+ .HasColumnType("boolean");++ b.Property<string>("PublicKey")+ .IsRequired()+ .HasMaxLength(2000)+ .HasColumnType("character varying(2000)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("UserId")+ .IsUnique()+ .HasDatabaseName("UX_UserGrantKeys_User_Primary")+ .HasFilter("\"IsPrimary\"");++ b.ToTable("UserGrantKeys");+ });++ modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int>("AccountKeyVersion")+ .HasColumnType("integer");++ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedAccountKey")+ .IsRequired()+ .HasColumnType("text");++ b.Property<string>("Label")+ .IsRequired()+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<DateTime?>("LastUsedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("Metadata")+ .HasColumnType("jsonb");++ b.Property<string>("Type")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.HasIndex("UserId", "Type", "Label")+ .IsUnique()+ .HasDatabaseName("UX_UserUnlockKeys_UserId_Type_Label");++ b.ToTable("UserUnlockKeys");+ });++ modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ {+ b.Property<string>("Hash")+ .HasMaxLength(64)+ .HasColumnType("character varying(64)");++ b.Property<string>("OwnerUserId")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<string>("Category")+ .IsRequired()+ .HasMaxLength(20)+ .HasColumnType("character varying(20)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<byte[]>("EncryptedData")+ .IsRequired()+ .HasColumnType("bytea");++ b.Property<int>("KeyVersion")+ .HasColumnType("integer");++ b.Property<DateTime>("LastReferencedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("SizeBytes")+ .HasColumnType("integer");++ b.HasKey("Hash", "OwnerUserId");++ b.HasIndex("OwnerUserId", "Category");++ b.ToTable("VaultBlobObjects");+ });++ modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>+ {+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");++ b.Property<long>("RevisionNumber")+ .HasColumnType("bigint");++ b.Property<string>("BlobHash")+ .HasMaxLength(64)+ .HasColumnType("character varying(64)");++ b.HasKey("ManifestId", "RevisionNumber", "BlobHash");++ b.ToTable("VaultBlobReferences");+ });++ modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>+ {+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");++ b.Property<string>("Category")+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<string>("CiphertextHash")+ .HasMaxLength(64)+ .HasColumnType("character varying(64)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<byte[]>("EncryptedData")+ .IsRequired()+ .HasColumnType("bytea");++ b.Property<int>("KeyVersion")+ .HasColumnType("integer");++ b.Property<long>("RevisionNumber")+ .HasColumnType("bigint");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("ManifestId", "Category");++ b.ToTable("VaultDataBuckets");+ });++ modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>+ {+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");++ b.Property<string>("Category")+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<long>("RevisionNumber")+ .HasColumnType("bigint");++ b.Property<string>("CiphertextHash")+ .HasMaxLength(64)+ .HasColumnType("character varying(64)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<byte[]>("EncryptedData")+ .IsRequired()+ .HasColumnType("bytea");++ b.Property<int>("KeyVersion")+ .HasColumnType("integer");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.HasKey("ManifestId", "Category", "RevisionNumber");++ b.ToTable("VaultDataBucketsHistory");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifest", b =>+ {+ b.Property<Guid>("ManifestId")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<string>("Client")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("CredentialsCount")+ .HasColumnType("integer");++ b.Property<int>("EmailClaimsCount")+ .HasColumnType("integer");++ b.Property<string>("EncryptionSettings")+ .HasColumnType("text");++ b.Property<string>("EncryptionType")+ .HasColumnType("text");++ b.Property<int>("FileSize")+ .HasColumnType("integer");++ b.Property<int>("KeyVersion")+ .HasColumnType("integer");++ b.Property<byte[]>("ManifestBlob")+ .HasColumnType("bytea");++ b.Property<string>("ManifestCiphertextHash")+ .HasMaxLength(64)+ .HasColumnType("character varying(64)");++ b.Property<Guid>("OwnerGroupId")+ .HasColumnType("uuid");++ b.Property<long>("RevisionNumber")+ .HasColumnType("bigint");++ b.Property<string>("Salt")+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("StorageFormat")+ .IsRequired()+ .HasMaxLength(20)+ .HasColumnType("character varying(20)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("VaultBlob")+ .HasColumnType("text");++ b.Property<string>("Verifier")+ .HasMaxLength(1000)+ .HasColumnType("character varying(1000)");++ b.Property<string>("Version")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("ManifestId");++ b.HasIndex("OwnerGroupId");++ b.ToTable("VaultManifests");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<int?>("AccountKeyVersion")+ .HasColumnType("integer");++ b.Property<string>("Algorithm")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("EncryptedVek")+ .IsRequired()+ .HasColumnType("text");++ b.Property<int>("KeyVersion")+ .HasColumnType("integer");++ b.Property<DateTime?>("LastUsedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("Metadata")+ .HasColumnType("jsonb");++ b.Property<string>("Type")+ .IsRequired()+ .HasMaxLength(30)+ .HasColumnType("character varying(30)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<Guid?>("UserGrantKeyId")+ .HasColumnType("uuid");++ b.Property<string>("UserId")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<Guid>("VaultManifestId")+ .HasColumnType("uuid");++ b.HasKey("Id");++ b.HasIndex("UserGrantKeyId");++ b.HasIndex("VaultManifestId")+ .HasDatabaseName("IX_VaultManifestAccessKeys_VaultManifestId");++ b.HasIndex("UserId", "Type", "VaultManifestId", "KeyVersion")+ .IsUnique()+ .HasDatabaseName("UX_VaultManifestAccessKeys_UserId_Type_Manifest_Version");++ b.ToTable("VaultManifestAccessKeys");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>+ {+ b.Property<Guid>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("uuid");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<bool>("IsPrimary")+ .HasColumnType("boolean");++ b.Property<string>("PublicKey")+ .IsRequired()+ .HasMaxLength(2000)+ .HasColumnType("character varying(2000)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<Guid>("VaultManifestId")+ .HasColumnType("uuid");++ b.HasKey("Id");++ b.HasIndex("VaultManifestId")+ .IsUnique()+ .HasDatabaseName("UX_VaultManifestDeliveryKeys_Manifest_Primary")+ .HasFilter("\"IsPrimary\"");++ b.HasIndex("VaultManifestId", "IsPrimary");++ b.ToTable("VaultManifestDeliveryKeys");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>+ {+ b.Property<Guid>("ManifestId")+ .HasColumnType("uuid");++ b.Property<long>("RevisionNumber")+ .HasColumnType("bigint");++ b.Property<string>("Client")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.Property<DateTime>("CreatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<int>("CredentialsCount")+ .HasColumnType("integer");++ b.Property<int>("EmailClaimsCount")+ .HasColumnType("integer");++ b.Property<string>("EncryptionSettings")+ .HasColumnType("text");++ b.Property<string>("EncryptionType")+ .HasColumnType("text");++ b.Property<int>("FileSize")+ .HasColumnType("integer");++ b.Property<int>("KeyVersion")+ .HasColumnType("integer");++ b.Property<byte[]>("ManifestBlob")+ .HasColumnType("bytea");++ b.Property<string>("ManifestCiphertextHash")+ .HasMaxLength(64)+ .HasColumnType("character varying(64)");++ b.Property<string>("Salt")+ .HasMaxLength(100)+ .HasColumnType("character varying(100)");++ b.Property<string>("StorageFormat")+ .IsRequired()+ .HasMaxLength(20)+ .HasColumnType("character varying(20)");++ b.Property<DateTime>("UpdatedAt")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("VaultBlob")+ .HasColumnType("text");++ b.Property<string>("Verifier")+ .HasMaxLength(1000)+ .HasColumnType("character varying(1000)");++ b.Property<string>("Version")+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("ManifestId", "RevisionNumber");++ b.ToTable("VaultManifestsHistory", (string)null);+ });++ modelBuilder.Entity("AliasVault.WorkerStatus.Database.WorkerServiceStatus", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<string>("CurrentStatus")+ .IsRequired()+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<string>("DesiredStatus")+ .IsRequired()+ .HasMaxLength(50)+ .HasColumnType("character varying(50)");++ b.Property<DateTime>("Heartbeat")+ .HasColumnType("timestamp with time zone");++ b.Property<string>("ServiceName")+ .IsRequired()+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");++ b.HasKey("Id");++ b.ToTable("WorkerServiceStatuses");+ });++ modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<string>("FriendlyName")+ .HasColumnType("text");++ b.Property<string>("Xml")+ .HasColumnType("text");++ b.HasKey("Id");++ b.ToTable("DataProtectionKeys");+ });++ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>+ {+ b.Property<int>("Id")+ .ValueGeneratedOnAdd()+ .HasColumnType("integer");++ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));++ b.Property<string>("ClaimType")+ .HasColumnType("text");++ b.Property<string>("ClaimValue")+ .HasColumnType("text");++ b.Property<string>("UserId")+ .HasColumnType("text");++ b.HasKey("Id");++ b.ToTable("UserClaims", (string)null);+ });++ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>+ {+ b.Property<string>("UserId")+ .HasColumnType("text");++ b.Property<string>("LoginProvider")+ .HasColumnType("text");++ b.Property<string>("Name")+ .HasColumnType("text");++ b.Property<string>("Value")+ .HasColumnType("text");++ b.HasKey("UserId", "LoginProvider", "Name");++ b.ToTable("UserTokens", (string)null);+ });++ modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>+ {+ b.HasOne("AliasServerDb.Group", "PersonalGroup")+ .WithOne()+ .HasForeignKey("AliasServerDb.AliasVaultUser", "PersonalGroupId")+ .OnDelete(DeleteBehavior.Restrict)+ .IsRequired();++ b.Navigation("PersonalGroup");+ });++ modelBuilder.Entity("AliasServerDb.AliasVaultUserRefreshToken", b =>+ {+ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany()+ .HasForeignKey("UserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("User");+ });++ modelBuilder.Entity("AliasServerDb.CapabilityRule", b =>+ {+ b.HasOne("AliasServerDb.Group", "Group")+ .WithMany()+ .HasForeignKey("GroupId")+ .OnDelete(DeleteBehavior.Cascade);++ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany()+ .HasForeignKey("UserId")+ .OnDelete(DeleteBehavior.Cascade);++ b.Navigation("Group");++ b.Navigation("User");+ });++ modelBuilder.Entity("AliasServerDb.ClientAction", b =>+ {+ b.HasOne("AliasServerDb.Group", "TargetGroup")+ .WithMany()+ .HasForeignKey("TargetGroupId")+ .OnDelete(DeleteBehavior.Cascade);++ b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")+ .WithMany()+ .HasForeignKey("TargetUserId")+ .OnDelete(DeleteBehavior.Cascade);++ b.Navigation("TargetGroup");++ b.Navigation("TargetUser");+ });++ modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>+ {+ b.HasOne("AliasServerDb.Email", "Email")+ .WithMany("Attachments")+ .HasForeignKey("EmailId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Email");+ });++ modelBuilder.Entity("AliasServerDb.EmailClaimLink", b =>+ {+ b.HasOne("AliasServerDb.EmailClaim", "EmailClaim")+ .WithMany("Links")+ .HasForeignKey("EmailClaimId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")+ .WithMany()+ .HasForeignKey("VaultManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("EmailClaim");++ b.Navigation("VaultManifest");+ });++ modelBuilder.Entity("AliasServerDb.EmailDecryptionKey", b =>+ {+ b.HasOne("AliasServerDb.Email", "Email")+ .WithMany("DecryptionKeys")+ .HasForeignKey("EmailId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.HasOne("AliasServerDb.VaultManifestDeliveryKey", "VaultManifestDeliveryKey")+ .WithMany("DecryptionKeys")+ .HasForeignKey("VaultManifestDeliveryKeyId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired()+ .HasConstraintName("FK_EmailDecryptionKeys_VaultManifestDeliveryKeys_DeliveryKeyId");++ b.Navigation("Email");++ b.Navigation("VaultManifestDeliveryKey");+ });++ modelBuilder.Entity("AliasServerDb.EmailPart", b =>+ {+ b.HasOne("AliasServerDb.Email", "Email")+ .WithMany("Parts")+ .HasForeignKey("EmailId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Email");+ });++ modelBuilder.Entity("AliasServerDb.GroupInvitation", b =>+ {+ b.HasOne("AliasServerDb.Group", "Group")+ .WithMany()+ .HasForeignKey("GroupId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.HasOne("AliasServerDb.AliasVaultUser", "Invitee")+ .WithMany()+ .HasForeignKey("InviteeUserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.HasOne("AliasServerDb.AliasVaultUser", "Inviter")+ .WithMany()+ .HasForeignKey("InviterUserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")+ .WithMany()+ .HasForeignKey("UserGrantKeyId")+ .OnDelete(DeleteBehavior.SetNull);++ b.Navigation("Group");++ b.Navigation("Invitee");++ b.Navigation("Inviter");++ b.Navigation("UserGrantKey");+ });++ modelBuilder.Entity("AliasServerDb.GroupMember", b =>+ {+ b.HasOne("AliasServerDb.Group", "Group")+ .WithMany("Members")+ .HasForeignKey("GroupId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany()+ .HasForeignKey("UserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Group");++ b.Navigation("User");+ });++ modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>+ {+ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany()+ .HasForeignKey("UserId")+ .OnDelete(DeleteBehavior.Cascade);++ b.Navigation("User");+ });++ modelBuilder.Entity("AliasServerDb.RateLimit", b =>+ {+ b.HasOne("AliasServerDb.Group", "Group")+ .WithMany()+ .HasForeignKey("GroupId")+ .OnDelete(DeleteBehavior.Cascade);++ b.Navigation("Group");+ });++ modelBuilder.Entity("AliasServerDb.UserGrantKey", b =>+ {+ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany()+ .HasForeignKey("UserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("User");+ });++ modelBuilder.Entity("AliasServerDb.UserUnlockKey", b =>+ {+ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany()+ .HasForeignKey("UserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("User");+ });++ modelBuilder.Entity("AliasServerDb.VaultBlobObject", b =>+ {+ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany()+ .HasForeignKey("OwnerUserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("User");+ });++ modelBuilder.Entity("AliasServerDb.VaultBlobReference", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "Manifest")+ .WithMany()+ .HasForeignKey("ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Manifest");+ });++ modelBuilder.Entity("AliasServerDb.VaultDataBucket", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "Manifest")+ .WithMany()+ .HasForeignKey("ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Manifest");+ });++ modelBuilder.Entity("AliasServerDb.VaultDataBucketsHistory", b =>+ {+ b.HasOne("AliasServerDb.VaultDataBucket", "Bucket")+ .WithMany()+ .HasForeignKey("ManifestId", "Category")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Bucket");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifest", b =>+ {+ b.HasOne("AliasServerDb.Group", "OwnerGroup")+ .WithMany()+ .HasForeignKey("OwnerGroupId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("OwnerGroup");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifestAccessKey", b =>+ {+ b.HasOne("AliasServerDb.UserGrantKey", "UserGrantKey")+ .WithMany()+ .HasForeignKey("UserGrantKeyId")+ .OnDelete(DeleteBehavior.SetNull);++ b.HasOne("AliasServerDb.AliasVaultUser", "User")+ .WithMany("VaultManifestAccessKeys")+ .HasForeignKey("UserId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("User");++ b.Navigation("UserGrantKey");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "VaultManifest")+ .WithMany()+ .HasForeignKey("VaultManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("VaultManifest");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifestsHistory", b =>+ {+ b.HasOne("AliasServerDb.VaultManifest", "Manifest")+ .WithMany()+ .HasForeignKey("ManifestId")+ .OnDelete(DeleteBehavior.Cascade)+ .IsRequired();++ b.Navigation("Manifest");+ });++ modelBuilder.Entity("AliasServerDb.AliasVaultUser", b =>+ {+ b.Navigation("VaultManifestAccessKeys");+ });++ modelBuilder.Entity("AliasServerDb.Email", b =>+ {+ b.Navigation("Attachments");++ b.Navigation("DecryptionKeys");++ b.Navigation("Parts");+ });++ modelBuilder.Entity("AliasServerDb.EmailClaim", b =>+ {+ b.Navigation("Links");+ });++ modelBuilder.Entity("AliasServerDb.Group", b =>+ {+ b.Navigation("Members");+ });++ modelBuilder.Entity("AliasServerDb.VaultManifestDeliveryKey", b =>+ {+ b.Navigation("DecryptionKeys");+ });+#pragma warning restore 612, 618+ }+ }+}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.cs b/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.csnew file mode 100644index 000000000..c4e13ae53--- /dev/null+++ b/apps/server/Databases/AliasServerDb/Migrations/20260822141154_WidenAuthLogRequestPath.cs@@ -0,0 +1,40 @@+using Microsoft.EntityFrameworkCore.Migrations;++#nullable disable++namespace AliasServerDb.Migrations+{+ /// <inheritdoc />+ public partial class WidenAuthLogRequestPath : Migration+ {+ /// <inheritdoc />+ protected override void Up(MigrationBuilder migrationBuilder)+ {+ migrationBuilder.AlterColumn<string>(+ name: "RequestPath",+ table: "AuthLogs",+ type: "character varying(255)",+ maxLength: 255,+ nullable: true,+ oldClrType: typeof(string),+ oldType: "character varying(100)",+ oldMaxLength: 100,+ oldNullable: true);+ }++ /// <inheritdoc />+ protected override void Down(MigrationBuilder migrationBuilder)+ {+ migrationBuilder.AlterColumn<string>(+ name: "RequestPath",+ table: "AuthLogs",+ type: "character varying(100)",+ maxLength: 100,+ nullable: true,+ oldClrType: typeof(string),+ oldType: "character varying(255)",+ oldMaxLength: 255,+ oldNullable: true);+ }+ }+}diff --git a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.csindex c7f8d623c..fdf3ce966 100644--- a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs@@ -252,8 +252,8 @@ namespace AliasServerDb.Migrations.HasColumnType("character varying(100)");b.Property<string>("RequestPath")- .HasMaxLength(100)- .HasColumnType("character varying(100)");+ .HasMaxLength(255)+ .HasColumnType("character varying(255)");b.Property<DateTime>("Timestamp").HasColumnType("timestamp with time zone");diff --git a/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.cs b/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.csindex c84886146..9d9ff74fc 100644--- a/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.cs+++ b/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.cs@@ -62,6 +62,16 @@ public enum AuthEventType/// </summary>Register = 30,+ /// <summary>+ /// Represents creation of a shared vault.+ /// </summary>+ SharedVaultCreation = 50,++ /// <summary>+ /// Represents deletion of a shared vault, confirmed with the master password.+ /// </summary>+ SharedVaultDeletion = 51,+/// <summary>/// Represents a user account deletion event./// </summary>diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/DeleteSharedManifestRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/DeleteSharedManifestRequest.csnew file mode 100644index 000000000..165120463--- /dev/null+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/DeleteSharedManifestRequest.cs@@ -0,0 +1,20 @@+//-----------------------------------------------------------------------+// <copyright file="DeleteSharedManifestRequest.cs" company="aliasvault">+// Copyright (c) aliasvault. All rights reserved.+// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.+// </copyright>+//-----------------------------------------------------------------------++namespace AliasVault.Shared.Models.WebApi.V2.Groups;++/// <summary>+/// Request for POST /v2/Groups/{groupId}/manifests/{manifestId}/delete/confirm.+/// </summary>+public class DeleteSharedManifestRequest+{+ /// <summary>Gets or sets the client's public ephemeral of the SRP handshake started by the initiate endpoint.</summary>+ public required string ClientPublicEphemeral { get; set; }++ /// <summary>Gets or sets the client's SRP session proof.</summary>+ public required string ClientSessionProof { get; set; }+}diff --git a/apps/server/Utilities/AliasVault.Auth/AuthLoggingService.cs b/apps/server/Utilities/AliasVault.Auth/AuthLoggingService.csindex ba1698299..77ccebede 100644--- a/apps/server/Utilities/AliasVault.Auth/AuthLoggingService.cs+++ b/apps/server/Utilities/AliasVault.Auth/AuthLoggingService.cs@@ -46,8 +46,8 @@ public class AuthLoggingService(IServiceProvider serviceProvider, IHttpContextAcIsSuccess = true,FailureReason = null,IpAddress = ipAddress,- Client = clientHeader,- RequestPath = httpContext?.Request.Path,+ Client = Truncate(clientHeader, AuthLog.ClientMaxLength),+ RequestPath = Truncate(httpContext?.Request.Path.Value, AuthLog.RequestPathMaxLength),DeviceType = DetermineDeviceType(httpContext),OperatingSystem = DetermineOperatingSystem(httpContext),Browser = DetermineBrowser(httpContext),@@ -92,8 +92,8 @@ public class AuthLoggingService(IServiceProvider serviceProvider, IHttpContextAcIsSuccess = false,FailureReason = failureReason,IpAddress = ipAddress,- Client = clientHeader,- RequestPath = httpContext?.Request.Path,+ Client = Truncate(clientHeader, AuthLog.ClientMaxLength),+ RequestPath = Truncate(httpContext?.Request.Path.Value, AuthLog.RequestPathMaxLength),DeviceType = DetermineDeviceType(httpContext),OperatingSystem = DetermineOperatingSystem(httpContext),Browser = DetermineBrowser(httpContext),@@ -105,6 +105,14 @@ public class AuthLoggingService(IServiceProvider serviceProvider, IHttpContextAcawait dbContext.SaveChangesAsync();}+ /// <summary>+ /// Truncates a request-supplied value to its column's maximum length, so an oversized value never breaks the operation being logged.+ /// </summary>+ /// <param name="value">The value to store.</param>+ /// <param name="maxLength">The column's maximum length.</param>+ /// <returns>The value, cut down to the maximum length when longer.</returns>+ private static string? Truncate(string? value, int maxLength) => value is not null && value.Length > maxLength ? value[..maxLength] : value;+/// <summary>/// Determines the type of device based on the User-Agent header./// </summary>diff --git a/core/models/src/webapi/AuthEventType.ts b/core/models/src/webapi/AuthEventType.tsindex 9991ea0c4..04f670702 100644--- a/core/models/src/webapi/AuthEventType.ts+++ b/core/models/src/webapi/AuthEventType.ts@@ -52,6 +52,16 @@ export enum AuthEventType {*/Register = 30,+ /**+ * Represents creation of a shared vault.+ */+ SharedVaultCreation = 50,++ /**+ * Represents deletion of a shared vault, confirmed with the master password.+ */+ SharedVaultDeletion = 51,+/*** Represents a user account deletion event.*/diff --git a/core/models/src/webapi/Groups.ts b/core/models/src/webapi/Groups.tsindex 55fc39bb4..bc544397b 100644--- a/core/models/src/webapi/Groups.ts+++ b/core/models/src/webapi/Groups.ts@@ -113,3 +113,22 @@ export type GrantManifestAccessRequest = {export type GrantManifestAccessResponse = {invitationId: string;}++/**+ * The SRP handshake served by POST /v2/Groups/{groupId}/manifests/{manifestId}/delete/initiate.+ */+export type DeleteSharedManifestInitiateResponse = {+ salt: string;+ serverEphemeral: string;+ encryptionType: string;+ encryptionSettings: string;+ srpIdentity: string;+}++/**+ * Delete a shared vault for good, carrying the SRP proof of the caller's master password.+ */+export type DeleteSharedManifestRequest = {+ clientPublicEphemeral: string;+ clientSessionProof: string;+}