Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add key version to group manifest invite (#2159)

Leendert de Borstc30e9fcdda6e
diff --git a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts
index 786c304e8..75b34d7bd 100644
--- a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts
+++ b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts
@@ -2576,7 +2576,7 @@ export async function handleGetRecentlySelected(
}
/**
- * Create another shared vault for a family, with this account as its first member.
+ * Create another shared manifest for a family, with this account as its first member.
*
* @param message - the family to create the vault for and the name to give it.
*/
@@ -2597,7 +2597,7 @@ export async function handleGroupCreateVault(message: { groupId: string; name: s
const group = overview.groups.find(candidate => candidate.groupId.toLowerCase() === message.groupId.toLowerCase());
if (!group || group.role === 'Member') {
- console.error(`Failed to create shared vault: group ${message.groupId} is not one this account administers.`);
+ console.error(`Failed to create shared manifest: group ${message.groupId} is not one this account administers.`);
return { success: false, error: await t('sharing.family.errors.createVaultFailed') };
}
@@ -2635,10 +2635,10 @@ export async function handleGroupCreateVault(message: { groupId: string; name: s
await SharingService.rotateManifestEncryptionKey(sqliteClient, mapping.manifestId);
await persistLocalVaultMutation(sqliteClient, encryptionKey);
- devLog(`[Sharing] Created shared vault ${mapping.manifestId} ("${name}") for group ${group.groupId}.`);
+ devLog(`[Sharing] Created shared manifest ${mapping.manifestId} ("${name}") for group ${group.groupId}.`);
return { success: true };
} catch (error) {
- console.error('Failed to create shared vault:', error);
+ console.error('Failed to create shared manifest:', error);
if (error instanceof ApiRequestError && error.apiErrorCode) {
return { success: false, apiErrorCode: error.apiErrorCode };
}
@@ -2654,7 +2654,7 @@ export async function handleGroupCreateVault(message: { groupId: string; name: s
}
/**
- * Invite a member of a family to one of its shared vaults, handing them the vault's key sealed for them.
+ * Invite a member of a family to one of its shared manifests, handing them the vault's key sealed for them.
*
* The recipient is picked off the family's own roster, so this never names an account outside the family.
* @param message - the family, the vault, and the member being invited.
@@ -2731,13 +2731,13 @@ export async function handleGroupInviteMember(message: { groupId: string; manife
return { success: false, apiErrorCode: error.apiErrorCode };
}
- console.error('Failed to invite member to shared vault:', error);
+ console.error('Failed to invite member to shared manifest:', error);
return { success: false, error: await t('sharing.family.errors.inviteFailed') };
}
}
/**
- * Take a member's access to one shared vault away, or hand back one's own.
+ * Take a member's access to one shared manifest away, or hand back one's own.
*
* @param message - the family, the vault, and the member losing access.
*/
@@ -2755,7 +2755,7 @@ export async function handleGroupRevokeAccess(message: { groupId: string; manife
return { success: false, apiErrorCode: error.apiErrorCode };
}
- console.error('Failed to revoke shared vault access:', error);
+ console.error('Failed to revoke shared manifest access:', error);
return { success: false, error: await t('sharing.family.errors.revokeAccessFailed') };
}
}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx
index 642e67a7d..b1a1c96cd 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Folders/DeleteFolderModal.tsx
@@ -84,7 +84,7 @@ const DeleteFolderModal: React.FC<DeleteFolderModalProps> = ({
}
>
<div className="space-y-4">
- {/* A shared vault: no delete options, only the hint */}
+ {/* A shared manifest: no delete options, only the hint */}
{sharedVault && (
<p className="pt-2 text-sm text-gray-600 dark:text-gray-400">
{t('items.deleteSharedFolderHint')}
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx
index 6d27fded9..ed0ec5789 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/items/ItemsList.tsx
@@ -171,7 +171,7 @@ const ItemsList: React.FC = () => {
return dbContext.sqliteClient.folders.getById(currentFolderId);
}, [currentFolderId, dbContext?.sqliteClient, folderRefreshKey]);
- // Whether it is the folder a shared vault is rendered as: left or revoked in Family Sharing, never deleted here
+ // Whether it is the folder a shared manifest is rendered as: left or revoked in Family Sharing, never deleted here
const currentFolderIsSharedVaultRoot = currentFolder !== null && multiManifestRendering.isManifestRoot(currentFolder);
// Get current folder's full path (for relative path computation in search results)
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx
index 5ddef942b..d56a64308 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/FamilySharingSettings.tsx
@@ -22,7 +22,7 @@ import { ApiRequestError } from '@/utils/types/errors/ApiRequestError';
type PendingRemoval = { group: GroupInfo; manifest: SharedManifestInfo; member: GroupMemberInfo; isSelf: boolean };
/**
- * A shared vault deletion in progress: first a plain warning, then the master password confirmation.
+ * A shared manifest deletion in progress: first a plain warning, then the master password confirmation.
*/
type PendingVaultDelete = { group: GroupInfo; manifest: SharedManifestInfo; stage: 'confirm' | 'password' };
@@ -33,7 +33,7 @@ class BackgroundActionError extends Error {}
class BackgroundApiError extends Error {}
/**
- * Family sharing settings page: create a family's shared vaults, invite the members of that family to them, and
+ * Family sharing settings page: create a family's shared manifests, invite the members of that family to them, and
* answer the invitations others sent.
*/
const FamilySharingSettings: React.FC = () => {
@@ -121,6 +121,7 @@ const FamilySharingSettings: React.FC = () => {
case 'ACCESS_ALREADY_GRANTED': return t('sharing.family.errors.alreadyHasAccess');
case 'INVITATION_ALREADY_EXISTS': return t('sharing.family.errors.alreadyInvited');
case 'INVITATION_NOT_FOUND': return t('sharing.family.errors.invitationGone');
+ case 'INVITATION_KEY_OUTDATED': return t('sharing.family.errors.invitationKeyOutdated');
case 'LAST_MANIFEST_GRANT_HOLDER': return t('sharing.family.errors.lastMemberWithAccess');
case 'GROUP_MANIFEST_LIMIT_REACHED': return t('sharing.family.errors.vaultLimitReached');
default: return code !== null ? `${fallback} [${code}]` : fallback;
@@ -140,7 +141,7 @@ const FamilySharingSettings: React.FC = () => {
};
/**
- * Create another shared vault for the family.
+ * Create another shared manifest for the family.
* @param group - the family to create it for.
*/
const createSharedVault = (group: GroupInfo): Promise<void> => {
@@ -157,7 +158,7 @@ const FamilySharingSettings: React.FC = () => {
};
/**
- * Invite one member to one shared vault.
+ * Invite one member to one shared manifest.
* @param group - the family the vault belongs to.
* @param manifest - the vault.
* @param member - the member being invited.
@@ -169,7 +170,7 @@ const FamilySharingSettings: React.FC = () => {
}, t('sharing.family.errors.inviteFailed'));
/**
- * Accept an invitation, opening the shared vault it names.
+ * Accept an invitation, opening the shared manifest it names.
* @param invitationId - the invitation to accept.
*/
const acceptInvitation = (invitationId: string): Promise<void> => run(async () => {
@@ -196,7 +197,7 @@ const FamilySharingSettings: React.FC = () => {
};
/**
- * Delete a shared vault with password confirmation.
+ * Delete a shared manifest with password confirmation.
* @param password - the entered master password.
*/
const deleteSharedVault = async (password: string): Promise<void> => {
@@ -236,7 +237,7 @@ const FamilySharingSettings: React.FC = () => {
const toggleRoster = (groupId: string): void => setExpandedRosters(previous => ({ ...previous, [groupId]: !isRosterExpanded(groupId) }));
/**
- * What to call a shared vault on screen.
+ * What to call a shared manifest on screen.
* @param manifest - the vault.
*/
const vaultLabel = (manifest: SharedManifestInfo): string => vaultNames[manifest.manifestId.toLowerCase()] ?? t('sharing.family.unnamedVault');
diff --git a/apps/browser-extension/src/utils/MultiManifestRendering.ts b/apps/browser-extension/src/utils/MultiManifestRendering.ts
index 916056a08..78a5503b6 100644
--- a/apps/browser-extension/src/utils/MultiManifestRendering.ts
+++ b/apps/browser-extension/src/utils/MultiManifestRendering.ts
@@ -118,7 +118,7 @@ const subfolderRendering: MultiManifestRenderer = {
}
await this.render(sqliteClient, manifest.manifestId, manifest.name ?? await defaultSharedVaultName());
- devWarn(`[Sharing] Shared vault ${manifest.manifestId} had no folder; recreated it.`);
+ devWarn(`[Sharing] Shared manifest ${manifest.manifestId} had no folder; recreated it.`);
mutated = true;
}
@@ -126,7 +126,7 @@ const subfolderRendering: MultiManifestRenderer = {
},
/**
- * The name of a shared vault is the name of the folder it is rendered as.
+ * The name of a shared manifest is the name of the folder it is rendered as.
* @param sqliteClient - The open local vault
*/
displayNames(sqliteClient: SqliteClient): Record<string, string> {
diff --git a/apps/browser-extension/src/utils/PendingActionProcessor.ts b/apps/browser-extension/src/utils/PendingActionProcessor.ts
index 71edfbaa9..e11309a35 100644
--- a/apps/browser-extension/src/utils/PendingActionProcessor.ts
+++ b/apps/browser-extension/src/utils/PendingActionProcessor.ts
@@ -84,7 +84,7 @@ export class PendingActionProcessor {
}
/**
- * Replace a shared vault's mail delivery keypair, which the server asks for after somebody who held the old private half was removed from the group.
+ * Replace a shared manifest's mail delivery keypair, which the server asks for after somebody who held the old private half was removed from the group.
* @param action - the action naming the manifest to rotate.
* @param sqliteClient - the open local vault.
*/
@@ -97,7 +97,7 @@ export class PendingActionProcessor {
}
await SharingService.rotateManifestEncryptionKey(sqliteClient, record.manifestId);
- devLog(`[PendingActions] Rotated the mail delivery key of shared vault ${record.manifestId}.`);
+ devLog(`[PendingActions] Rotated the mail delivery key of shared manifest ${record.manifestId}.`);
return { vaultChanged: true, completed: true };
}
diff --git a/apps/browser-extension/src/utils/SharingService.ts b/apps/browser-extension/src/utils/SharingService.ts
index cfe450bea..ca6fbb543 100644
--- a/apps/browser-extension/src/utils/SharingService.ts
+++ b/apps/browser-extension/src/utils/SharingService.ts
@@ -17,8 +17,8 @@ import type { WebApiService } from '@/utils/WebApiService';
*/
/**
- * A shared vault about to be created, with the creator's own public key: the VEK is encrypted for it and for nothing
- * else, because a new vault starts out with one member and everybody who is let in afterwards gets the key encrypted
+ * A shared manifest about to be created, with the creator's own public key: the VEK is encrypted for it and for nothing
+ * else, because a new manifest starts out with one member and everybody who is let in afterwards gets the key encrypted
* for them inside the invitation that lets them in.
*/
export type ShareTarget = {
@@ -36,7 +36,7 @@ export type ManifestVekGrant = {
};
/**
- * The client-side mapping of a newly created shared vault.
+ * The client-side mapping of a newly created shared manifest.
*/
export type SharedManifestMapping = ManifestVekGrant & { manifestId: string; salt: string; revision: number };
@@ -56,7 +56,7 @@ export type SharedManifestRecord = ManifestVekGrant & {
*/
export class SharingService {
/**
- * The families this user belongs to, their shared vaults, and the invitations awaiting an answer.
+ * The families this user belongs to, their shared manifests, and the invitations awaiting an answer.
* @param webApi - API client to reuse.
*/
public static async getOverview(webApi: WebApiService): Promise<GroupOverviewResponse> {
@@ -64,10 +64,10 @@ export class SharingService {
}
/**
- * Create a shared group's vault.
+ * Create a shared group's manifest.
* @param webApi - API client to reuse.
- * @param group - the group to create the vault for, with this client's own public key to encrypt its VEK for.
- * @param manifestId - the client-minted id of the new vault.
+ * @param group - the group to create the manifest for, with this client's own public key to encrypt its VEK for.
+ * @param manifestId - the client-minted id of the new manifest.
*/
public static async createSharedManifest(webApi: WebApiService, group: ShareTarget, manifestId: string): Promise<SharedManifestMapping> {
const manifestVek = EncryptionUtility.generateVaultEncryptionKey();
@@ -91,8 +91,8 @@ export class SharingService {
}
/**
- * Encrypt a shared vault's VEK for one member of the group.
- * @param manifestVek - the shared vault's VEK.
+ * Encrypt a shared manifest's VEK for one member of the group.
+ * @param manifestVek - the shared manifest's VEK.
* @param member - the member to encrypt it for.
* @param vaultName - what the vault is called, or null when this client has no name for it.
*/
@@ -140,12 +140,12 @@ export class SharingService {
}
/**
- * Invite a member of the group to one of its shared vaults.
+ * Invite a member of the group to one of its shared manifests.
* @param webApi - API client to reuse.
- * @param groupId - the group the vault belongs to.
- * @param manifestId - the shared vault to invite them to.
+ * @param groupId - the group the manifest belongs to.
+ * @param manifestId - the shared manifest to invite them to.
* @param userId - the member being invited.
- * @param grant - the vault's key, encrypted for that member, as produced by {@link encryptVekFor}.
+ * @param grant - the manifest's key, encrypted for that member, as produced by {@link encryptVekFor}.
* @param algorithm - the algorithm the grant was encrypted with.
*/
public static async inviteMember(webApi: WebApiService, groupId: string, manifestId: string, userId: string, grant: ManifestGrant, algorithm: VaultKeyAlgorithmValue): Promise<void> {
@@ -153,10 +153,10 @@ export class SharingService {
}
/**
- * Take a member's access to one shared vault away, or hand back one's own. The server refuses the latter for group admins.
+ * Take a member's access to one shared manifest away, or hand back one's own. The server refuses the latter for group admins.
* @param webApi - API client to reuse.
- * @param groupId - the group the vault belongs to.
- * @param manifestId - the shared vault.
+ * @param groupId - the group the manifest belongs to.
+ * @param manifestId - the shared manifest.
* @param userId - the member losing access.
*/
public static async revokeAccess(webApi: WebApiService, groupId: string, manifestId: string, userId: string): Promise<void> {
@@ -164,11 +164,11 @@ export class SharingService {
}
/**
- * Delete a shared vault for good, taking it away from every member at once. The server requires proof of the
+ * Delete a shared manifest for good, taking it away from every member at once. The server requires proof of the
* caller's master password, so this runs the SRP handshake the account deletion flow also uses.
* @param webApi - API client to reuse.
- * @param groupId - the group the vault belongs to.
- * @param manifestId - the shared vault to delete.
+ * @param groupId - the group the manifest belongs to.
+ * @param manifestId - the shared manifest to delete.
* @param password - the caller's master password, proven to the server and forgotten.
*/
public static async deleteSharedManifest(webApi: WebApiService, groupId: string, manifestId: string, password: string): Promise<void> {
@@ -188,7 +188,7 @@ export class SharingService {
}
/**
- * Accept an invitation addressed to this user, opening the shared vault it names.
+ * Accept an invitation addressed to this user, opening the shared manifest it names.
* @param webApi - API client to reuse.
* @param invitationId - the invitation to accept.
*/
diff --git a/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts b/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts
index ed38568dc..3af1c8357 100644
--- a/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts
+++ b/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts
@@ -239,7 +239,7 @@ export class FolderRepository extends BaseRepository {
}
/**
- * Refuse to delete a folder that a shared vault is rendered as (see {@link multiManifestRendering}).
+ * Refuse to delete a folder that a shared manifest is rendered as (see {@link multiManifestRendering}).
* @param folderId - The folder about to be deleted
*/
private async assertDeletable(folderId: string): Promise<void> {
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.ts
index 615507eac..a0255b367 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
@@ -400,11 +400,11 @@ declare enum AuthEventType {
*/
Register = 30,
/**
- * Represents creation of a shared vault.
+ * Represents creation of a shared manifest.
*/
SharedVaultCreation = 50,
/**
- * Represents deletion of a shared vault, confirmed with the master password.
+ * Represents deletion of a shared manifest, confirmed with the master password.
*/
SharedVaultDeletion = 51,
/**
@@ -550,7 +550,7 @@ type GroupMemberInfo = {
publicKey: string | null;
};
/**
- * An offer of access to a shared vault that is still awaiting the recipient's answer.
+ * An offer of access to a shared manifest that is still awaiting the recipient's answer.
*/
type SentManifestInvitation = {
id: string;
@@ -559,7 +559,7 @@ type SentManifestInvitation = {
createdAt: string;
};
/**
- * An open offer of access to a shared vault, addressed to this user.
+ * An open offer of access to a shared manifest, addressed to this user.
*/
type ReceivedManifestInvitation = {
id: string;
@@ -571,7 +571,7 @@ type ReceivedManifestInvitation = {
recipientPublicKey: string | null;
};
/**
- * One shared vault owned by a group, with the members who can open it.
+ * One shared manifest owned by a group, with the members who can open it.
*/
type SharedManifestInfo = {
manifestId: string;
@@ -595,7 +595,7 @@ type GroupOverviewResponse = {
receivedInvitations: ReceivedManifestInvitation[];
};
/**
- * Create another shared vault for a group.
+ * Create another shared manifest for a group.
*/
type CreateSharedManifestRequest = {
manifestId: string;
@@ -611,7 +611,7 @@ type CreateSharedManifestResponse = {
revisionNumber: number;
};
/**
- * One recipient's copy of a shared vault's VEK, encrypted for a public key of theirs.
+ * One recipient's copy of a shared manifest's VEK, encrypted for a public key of theirs.
*/
type ManifestGrant = {
recipientUserId: string;
@@ -620,7 +620,7 @@ type ManifestGrant = {
encryptedName?: string | null;
};
/**
- * Give a member of the group access to one of its shared vaults.
+ * Give a member of the group access to one of its shared manifests.
*/
type GrantManifestAccessRequest = {
userId: string;
@@ -644,7 +644,7 @@ type DeleteSharedManifestInitiateResponse = {
srpIdentity: string;
};
/**
- * Delete a shared vault for good, carrying the SRP proof of the caller's master password.
+ * Delete a shared manifest for good, carrying the SRP proof of the caller's master password.
*/
type DeleteSharedManifestRequest = {
clientPublicEphemeral: string;
@@ -658,7 +658,7 @@ type DeleteSharedManifestRequest = {
*/
declare const CapabilityKeys: {
/**
- * Shared vaults: creating one, inviting people to it, and accepting an invitation to one. The capability
+ * Shared manifests: creating one, inviting people to it, and accepting an invitation to one. The capability
* behind the Family Sharing screens, and behind anything else built on a vault more than one account holds.
*/
readonly VaultSharing: "vault-sharing";
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.js
index 5c820840b..8ce5f7407 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
@@ -55,7 +55,7 @@ var VaultKeyAlgorithm = {
// src/webapi/CapabilityKeys.ts
var CapabilityKeys = {
/**
- * Shared vaults: creating one, inviting people to it, and accepting an invitation to one. The capability
+ * Shared manifests: creating one, inviting people to it, and accepting an invitation to one. The capability
* behind the Family Sharing screens, and behind anything else built on a vault more than one account holds.
*/
VaultSharing: "vault-sharing"
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.ts
index 615507eac..a0255b367 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
@@ -400,11 +400,11 @@ declare enum AuthEventType {
*/
Register = 30,
/**
- * Represents creation of a shared vault.
+ * Represents creation of a shared manifest.
*/
SharedVaultCreation = 50,
/**
- * Represents deletion of a shared vault, confirmed with the master password.
+ * Represents deletion of a shared manifest, confirmed with the master password.
*/
SharedVaultDeletion = 51,
/**
@@ -550,7 +550,7 @@ type GroupMemberInfo = {
publicKey: string | null;
};
/**
- * An offer of access to a shared vault that is still awaiting the recipient's answer.
+ * An offer of access to a shared manifest that is still awaiting the recipient's answer.
*/
type SentManifestInvitation = {
id: string;
@@ -559,7 +559,7 @@ type SentManifestInvitation = {
createdAt: string;
};
/**
- * An open offer of access to a shared vault, addressed to this user.
+ * An open offer of access to a shared manifest, addressed to this user.
*/
type ReceivedManifestInvitation = {
id: string;
@@ -571,7 +571,7 @@ type ReceivedManifestInvitation = {
recipientPublicKey: string | null;
};
/**
- * One shared vault owned by a group, with the members who can open it.
+ * One shared manifest owned by a group, with the members who can open it.
*/
type SharedManifestInfo = {
manifestId: string;
@@ -595,7 +595,7 @@ type GroupOverviewResponse = {
receivedInvitations: ReceivedManifestInvitation[];
};
/**
- * Create another shared vault for a group.
+ * Create another shared manifest for a group.
*/
type CreateSharedManifestRequest = {
manifestId: string;
@@ -611,7 +611,7 @@ type CreateSharedManifestResponse = {
revisionNumber: number;
};
/**
- * One recipient's copy of a shared vault's VEK, encrypted for a public key of theirs.
+ * One recipient's copy of a shared manifest's VEK, encrypted for a public key of theirs.
*/
type ManifestGrant = {
recipientUserId: string;
@@ -620,7 +620,7 @@ type ManifestGrant = {
encryptedName?: string | null;
};
/**
- * Give a member of the group access to one of its shared vaults.
+ * Give a member of the group access to one of its shared manifests.
*/
type GrantManifestAccessRequest = {
userId: string;
@@ -644,7 +644,7 @@ type DeleteSharedManifestInitiateResponse = {
srpIdentity: string;
};
/**
- * Delete a shared vault for good, carrying the SRP proof of the caller's master password.
+ * Delete a shared manifest for good, carrying the SRP proof of the caller's master password.
*/
type DeleteSharedManifestRequest = {
clientPublicEphemeral: string;
@@ -658,7 +658,7 @@ type DeleteSharedManifestRequest = {
*/
declare const CapabilityKeys: {
/**
- * Shared vaults: creating one, inviting people to it, and accepting an invitation to one. The capability
+ * Shared manifests: creating one, inviting people to it, and accepting an invitation to one. The capability
* behind the Family Sharing screens, and behind anything else built on a vault more than one account holds.
*/
readonly VaultSharing: "vault-sharing";
diff --git a/apps/mobile-app/utils/dist/core/models/webapi/index.js b/apps/mobile-app/utils/dist/core/models/webapi/index.js
index 5c820840b..8ce5f7407 100644
--- a/apps/mobile-app/utils/dist/core/models/webapi/index.js
+++ b/apps/mobile-app/utils/dist/core/models/webapi/index.js
@@ -55,7 +55,7 @@ var VaultKeyAlgorithm = {
// src/webapi/CapabilityKeys.ts
var CapabilityKeys = {
/**
- * Shared vaults: creating one, inviting people to it, and accepting an invitation to one. The capability
+ * Shared manifests: creating one, inviting people to it, and accepting an invitation to one. The capability
* behind the Family Sharing screens, and behind anything else built on a vault more than one account holds.
*/
VaultSharing: "vault-sharing"
diff --git a/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs b/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs
index 1eb08dc4b..8c3335166 100644
--- a/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs
+++ b/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs
@@ -26,20 +26,20 @@ 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.
+/// Groups controller which manages the shared manifests of a group and who inside the group can open them.
/// </summary>
/// <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>
+/// <param name="authLoggingService">Auth logging service, recording shared manifest creation and the master password checks guarding deletion.</param>
[ApiVersion("2")]
public class GroupsController(IAliasServerDbContextFactory dbContextFactory, UserManager<AliasVaultUser> userManager, ITimeProvider timeProvider, IMemoryCache cache, AuthLoggingService authLoggingService) : AuthenticatedRequestController(userManager)
{
private const string ManifestFormat = "manifest-v1";
/// <summary>
- /// How many shared vaults one group may hold. TODO: hardcoded for now; make this dynamic when needed.
+ /// How many shared manifests one group may hold. TODO: hardcoded for now; make this dynamic when needed.
/// </summary>
private const int MaxSharedVaults = 3;
@@ -130,7 +130,7 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
}
/// <summary>
- /// Create another shared vault for a group, together with the caller's own grant on it.
+ /// Create another shared manifest for a group, together with the caller's own grant on it.
/// </summary>
/// <param name="groupId">The shared group ID.</param>
/// <param name="model">The create manifest request.</param>
@@ -192,7 +192,7 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
UpdatedAt = timeProvider.UtcNow,
};
context.VaultManifests.Add(manifest);
- context.VaultManifestAccessKeys.Add(GrantHelper.BuildGrant(manifest.ManifestId, me.Id, selfPublicKeyId.Value, model.SelfEncryptedVek, algorithm, timeProvider.UtcNow));
+ context.VaultManifestAccessKeys.Add(GrantHelper.BuildGrant(manifest.ManifestId, me.Id, selfPublicKeyId.Value, model.SelfEncryptedVek, algorithm, manifest.KeyVersion, timeProvider.UtcNow));
try
{
@@ -210,11 +210,11 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
}
/// <summary>
- /// Offer a member of the group access to one of its shared vaults, handing over the vault key sealed for them in
+ /// Offer a member of the group access to one of its shared manifests, handing over the vault key sealed for them in
/// the same call. The offer becomes a grant once they accept it.
/// </summary>
/// <param name="groupId">The group ID.</param>
- /// <param name="manifestId">The shared vault to give access to.</param>
+ /// <param name="manifestId">The shared manifest to give access to.</param>
/// <param name="model">The grant request.</param>
/// <returns>The created invitation id.</returns>
[HttpPost("{groupId:guid}/manifests/{manifestId:guid}/access")]
@@ -238,7 +238,12 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.GROUP_NOT_FOUND, 404));
}
- if (!await context.VaultManifests.AnyAsync(m => m.ManifestId == manifestId && m.OwnerGroupId == groupId))
+ var manifestKeyVersion = await context.VaultManifests
+ .Where(m => m.ManifestId == manifestId && m.OwnerGroupId == groupId)
+ .Select(m => (int?)m.KeyVersion)
+ .FirstOrDefaultAsync();
+
+ if (manifestKeyVersion is null)
{
return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.SHARED_MANIFEST_NOT_FOUND, 404));
}
@@ -276,6 +281,8 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
return BadRequest(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.ACCESS_ALREADY_GRANTED, 400));
}
+ await CloseStaleInvitationsAsync(context, manifestId, manifestKeyVersion.Value);
+
if (await context.GroupInvitations.AnyAsync(i => i.VaultManifestId == manifestId && i.InviteeUserId == model.UserId && i.State == GroupInvitationState.Pending))
{
return BadRequest(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.INVITATION_ALREADY_EXISTS, 400));
@@ -293,6 +300,7 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
EncryptedVek = model.Grant.EncryptedVek,
EncryptedName = model.Grant.EncryptedName,
UserGrantKeyId = model.Grant.RecipientPublicKeyId,
+ VaultKeyVersion = manifestKeyVersion.Value,
Algorithm = algorithm,
CreatedAt = timeProvider.UtcNow,
UpdatedAt = timeProvider.UtcNow,
@@ -376,10 +384,10 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
}
/// <summary>
- /// Begin deleting one of the group's shared vaults.
+ /// Begin deleting one of the group's shared manifests.
/// </summary>
/// <param name="groupId">The group ID.</param>
- /// <param name="manifestId">The shared vault to delete.</param>
+ /// <param name="manifestId">The shared manifest 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)
@@ -415,10 +423,10 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
}
/// <summary>
- /// Delete one of the group's shared vaults (confirmed with the master password).
+ /// Delete one of the group's shared manifests (confirmed with the master password).
/// </summary>
/// <param name="groupId">The group ID.</param>
- /// <param name="manifestId">The shared vault to delete.</param>
+ /// <param name="manifestId">The shared manifest 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")]
@@ -517,7 +525,25 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.INVITATION_NOT_FOUND, 404));
}
- if (!await PromoteSealedGrantAsync(context, invitation, me.Id))
+ var manifestKeyVersion = invitation.VaultManifestId is null ? null : await context.VaultManifests
+ .Where(m => m.ManifestId == invitation.VaultManifestId.Value && m.OwnerGroupId == invitation.GroupId)
+ .Select(m => (int?)m.KeyVersion)
+ .FirstOrDefaultAsync();
+
+ if (manifestKeyVersion is null)
+ {
+ return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.INVITATION_NOT_FOUND, 404));
+ }
+
+ // If the current manifest key version is different from the one the invitation was sealed under, it is no longer valid.
+ if (manifestKeyVersion.Value != invitation.VaultKeyVersion)
+ {
+ CloseInvitation(invitation, GroupInvitationState.Stale);
+ await context.SaveChangesAsync();
+ return BadRequest(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.INVITATION_KEY_OUTDATED, 400));
+ }
+
+ if (!await PromoteSealedGrantAsync(context, invitation, me.Id, manifestKeyVersion.Value))
{
return NotFound(ApiErrorCodeHelper.CreateValidationErrorResponse(ApiErrorCode.INVITATION_NOT_FOUND, 404));
}
@@ -590,7 +616,7 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
}
/// <summary>
- /// The open offers of access to each shared vault, for the admins who may withdraw them.
+ /// The open offers of access to each shared manifest, for the admins who may withdraw them.
/// </summary>
/// <param name="context">Database context.</param>
/// <param name="groupIds">The groups to list offers of.</param>
@@ -677,8 +703,9 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
/// <param name="context">The database context.</param>
/// <param name="invitation">The invitation being accepted.</param>
/// <param name="userId">The accepting user.</param>
+ /// <param name="keyVersion">The manifest's current VEK version, already checked against the offer's.</param>
/// <returns>Whether the accepting user ends up holding a grant on the vault.</returns>
- private async Task<bool> PromoteSealedGrantAsync(AliasServerDbContext context, GroupInvitation invitation, string userId)
+ private async Task<bool> PromoteSealedGrantAsync(AliasServerDbContext context, GroupInvitation invitation, string userId, int keyVersion)
{
if (invitation.EncryptedVek is null || invitation.UserGrantKeyId is null || invitation.VaultManifestId is null)
{
@@ -686,18 +713,32 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use
}
var manifestId = invitation.VaultManifestId.Value;
- if (!await context.VaultManifests.AnyAsync(m => m.ManifestId == manifestId && m.OwnerGroupId == invitation.GroupId))
- {
- return false;
- }
-
if (await context.VaultManifestAccessKeys.AnyAsync(k => k.VaultManifestId == manifestId && k.UserId == userId && k.Type == ManifestKeyType.GrantKey))
{
return true;
}
- context.VaultManifestAccessKeys.Add(GrantHelper.BuildGrant(manifestId, userId, invitation.UserGrantKeyId.Value, invitation.EncryptedVek, invitation.Algorithm, timeProvider.UtcNow));
+ context.VaultManifestAccessKeys.Add(GrantHelper.BuildGrant(manifestId, userId, invitation.UserGrantKeyId.Value, invitation.EncryptedVek, invitation.Algorithm, keyVersion, timeProvider.UtcNow));
return true;
}
+
+ /// <summary>
+ /// Close every open offer of access to a manifest whose sealed key predates the manifest's current one, as accepting it would fail anyway.
+ /// </summary>
+ /// <param name="context">The database context.</param>
+ /// <param name="manifestId">The shared manifest.</param>
+ /// <param name="keyVersion">The manifest's current VEK version.</param>
+ /// <returns>A task.</returns>
+ private async Task CloseStaleInvitationsAsync(AliasServerDbContext context, Guid manifestId, int keyVersion)
+ {
+ var stale = await context.GroupInvitations
+ .Where(i => i.VaultManifestId == manifestId && i.State == GroupInvitationState.Pending && i.VaultKeyVersion != keyVersion)
+ .ToListAsync();
+
+ foreach (var invitation in stale)
+ {
+ CloseInvitation(invitation, GroupInvitationState.Stale);
+ }
+ }
}
diff --git a/apps/server/AliasVault.Api/Helpers/GrantHelper.cs b/apps/server/AliasVault.Api/Helpers/GrantHelper.cs
index 4aefd800f..e205f3acb 100644
--- a/apps/server/AliasVault.Api/Helpers/GrantHelper.cs
+++ b/apps/server/AliasVault.Api/Helpers/GrantHelper.cs
@@ -24,9 +24,10 @@ public static class GrantHelper
/// <param name="publicKeyId">The recipient public key ID.</param>
/// <param name="encryptedVek">The encrypted VEK.</param>
/// <param name="algorithm">The algorithm it was encrypted with.</param>
+ /// <param name="keyVersion">The version of the manifest's VEK that <paramref name="encryptedVek"/> yields.</param>
/// <param name="now">Current time.</param>
/// <returns>The unpersisted grant.</returns>
- public static VaultManifestAccessKey BuildGrant(Guid manifestId, string userId, Guid publicKeyId, string encryptedVek, VaultKeyAlgorithm algorithm, DateTime now)
+ public static VaultManifestAccessKey BuildGrant(Guid manifestId, string userId, Guid publicKeyId, string encryptedVek, VaultKeyAlgorithm algorithm, int keyVersion, DateTime now)
{
return new VaultManifestAccessKey
{
@@ -36,6 +37,7 @@ public static class GrantHelper
Type = ManifestKeyType.GrantKey,
Algorithm = algorithm,
EncryptedVek = encryptedVek,
+ KeyVersion = keyVersion,
UserGrantKeyId = publicKeyId,
CreatedAt = now,
UpdatedAt = now,
diff --git a/apps/server/AliasVault.Api/Helpers/MemberPublicKey.cs b/apps/server/AliasVault.Api/Helpers/MemberPublicKey.cs
index 9cbfa38a3..c650cd8ef 100644
--- a/apps/server/AliasVault.Api/Helpers/MemberPublicKey.cs
+++ b/apps/server/AliasVault.Api/Helpers/MemberPublicKey.cs
@@ -8,7 +8,7 @@
namespace AliasVault.Api.Helpers;
/// <summary>
-/// The public key a shared vault's key is sealed for when it is handed to somebody.
+/// The public key a shared manifest's key is sealed for when it is handed to somebody.
/// </summary>
/// <param name="PublicKeyId">The id of the key row.</param>
/// <param name="PublicKey">The public key itself (JWK).</param>
diff --git a/apps/server/Databases/AliasServerDb/GroupInvitation.cs b/apps/server/Databases/AliasServerDb/GroupInvitation.cs
index 093003e82..db073fe67 100644
--- a/apps/server/Databases/AliasServerDb/GroupInvitation.cs
+++ b/apps/server/Databases/AliasServerDb/GroupInvitation.cs
@@ -70,12 +70,12 @@ public class GroupInvitation
public Guid? VaultManifestId { get; set; }
/// <summary>
- /// Gets or sets the shared vault's VEK, encrypted for the invitee's public key.
+ /// Gets or sets the shared manifest's VEK, encrypted for the invitee's public key.
/// </summary>
public string? EncryptedVek { get; set; }
/// <summary>
- /// Gets or sets the shared vault's name, encrypted for the same public key as the <see cref="EncryptedVek"/>.
+ /// Gets or sets the shared manifest's name, encrypted for the same public key as the <see cref="EncryptedVek"/>.
/// </summary>
public string? EncryptedName { get; set; }
@@ -89,6 +89,12 @@ public class GroupInvitation
/// </summary>
public virtual UserGrantKey? UserGrantKey { get; set; }
+ /// <summary>
+ /// Gets or sets the version of the manifest's VEK that this invitation was sealed under. Used to check
+ /// if this invitation is still valid for the manifest upon accepting.
+ /// </summary>
+ public int VaultKeyVersion { get; set; }
+
/// <summary>
/// Gets or sets the algorithm the <see cref="EncryptedVek"/> is encrypted with.
/// </summary>
diff --git a/apps/server/Databases/AliasServerDb/GroupInvitationState.cs b/apps/server/Databases/AliasServerDb/GroupInvitationState.cs
index 126a187ee..98864b504 100644
--- a/apps/server/Databases/AliasServerDb/GroupInvitationState.cs
+++ b/apps/server/Databases/AliasServerDb/GroupInvitationState.cs
@@ -31,4 +31,10 @@ public enum GroupInvitationState
/// Withdrawn by the inviter (or another group admin) before it was answered.
/// </summary>
Revoked = 3,
+
+ /// <summary>
+ /// The vault's key was rotated after the invitation was made, so the key sealed into it no longer opens the vault and
+ /// accepting it would hand the invitee a grant they cannot use. The inviter has to make a fresh invitation.
+ /// </summary>
+ Stale = 4,
}
diff --git a/apps/server/Databases/AliasServerDb/GroupType.cs b/apps/server/Databases/AliasServerDb/GroupType.cs
index ccb752132..0c5cffd51 100644
--- a/apps/server/Databases/AliasServerDb/GroupType.cs
+++ b/apps/server/Databases/AliasServerDb/GroupType.cs
@@ -18,7 +18,7 @@ public enum GroupType
Personal = 0,
/// <summary>
- /// A group users join by invitation to be able to participate in shared vaults. Represents "family" in UI.
+ /// A group users join by invitation to be able to participate in shared manifests. Represents "family" in UI.
/// </summary>
Shared = 1,
}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.Designer.cs
new file mode 100644
index 000000000..5b1677061
--- /dev/null
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.Designer.cs
@@ -0,0 +1,1930 @@
+// <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("20260822183612_AddGroupInvitationVaultKeyVersion")]
+ partial class AddGroupInvitationVaultKeyVersion
+ {
+ /// <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<int>("VaultKeyVersion")
+ .HasColumnType("integer");
+
+ 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/20260822183612_AddGroupInvitationVaultKeyVersion.cs b/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.cs
new file mode 100644
index 000000000..452f22ecf
--- /dev/null
+++ b/apps/server/Databases/AliasServerDb/Migrations/20260822183612_AddGroupInvitationVaultKeyVersion.cs
@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace AliasServerDb.Migrations
+{
+ /// <inheritdoc />
+ public partial class AddGroupInvitationVaultKeyVersion : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn<int>(
+ name: "VaultKeyVersion",
+ table: "GroupInvitations",
+ type: "integer",
+ nullable: false,
+ defaultValue: 0);
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "VaultKeyVersion",
+ table: "GroupInvitations");
+ }
+ }
+}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
index fdf3ce966..c3aa31ed2 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
@@ -760,6 +760,9 @@ namespace AliasServerDb.Migrations
b.Property<Guid?>("UserGrantKeyId")
.HasColumnType("uuid");
+ b.Property<int>("VaultKeyVersion")
+ .HasColumnType("integer");
+
b.Property<Guid?>("VaultManifestId")
.HasColumnType("uuid");
diff --git a/apps/server/Shared/AliasVault.Shared.Server/Capabilities/CapabilityKeys.cs b/apps/server/Shared/AliasVault.Shared.Server/Capabilities/CapabilityKeys.cs
index 61b8f0d11..bae783064 100644
--- a/apps/server/Shared/AliasVault.Shared.Server/Capabilities/CapabilityKeys.cs
+++ b/apps/server/Shared/AliasVault.Shared.Server/Capabilities/CapabilityKeys.cs
@@ -13,7 +13,7 @@ namespace AliasVault.Shared.Server.Capabilities;
public static class CapabilityKeys
{
/// <summary>
- /// Shared vaults.
+ /// Shared manifests.
/// </summary>
public const string VaultSharing = "vault-sharing";
}
diff --git a/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs b/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs
index ed433d730..66a8b8778 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs
@@ -170,7 +170,7 @@ public enum ApiErrorCode
SHARED_MANIFEST_NOT_FOUND,
/// <summary>
- /// The recipient has no usable public key to encrypt a shared vault key for, or the referenced key is invalid.
+ /// The recipient has no usable public key to encrypt a shared manifest key for, or the referenced key is invalid.
/// </summary>
RECIPIENT_KEY_NOT_FOUND,
@@ -195,7 +195,7 @@ public enum ApiErrorCode
GROUP_NOT_FOUND,
/// <summary>
- /// The group already holds as many shared vaults as it is entitled to, so no further one can be created.
+ /// The group already holds as many shared manifests as it is entitled to, so no further one can be created.
/// </summary>
GROUP_MANIFEST_LIMIT_REACHED,
@@ -205,7 +205,7 @@ public enum ApiErrorCode
INVITATION_NOT_FOUND,
/// <summary>
- /// There is already an open offer of access to this shared vault for this member.
+ /// There is already an open offer of access to this shared manifest for this member.
/// </summary>
INVITATION_ALREADY_EXISTS,
@@ -216,7 +216,7 @@ public enum ApiErrorCode
NOT_GROUP_MEMBER,
/// <summary>
- /// The member already holds access to this shared vault.
+ /// The member already holds access to this shared manifest.
/// </summary>
ACCESS_ALREADY_GRANTED,
@@ -226,17 +226,23 @@ public enum ApiErrorCode
CANNOT_REVOKE_OWN_ACCESS,
/// <summary>
- /// The member is the last one who can open one of the group's shared vaults, so taking their access away would
+ /// The member is the last one who can open one of the group's shared manifests, so taking their access away would
/// leave that vault unopenable. Somebody else has to be given access to it first.
/// </summary>
LAST_MANIFEST_GRANT_HOLDER,
/// <summary>
- /// The account access was offered to has published no public key, so a shared vault key cannot be encrypted for
+ /// The account access was offered to has published no public key, so a shared manifest key cannot be encrypted for
/// it. That account has to finish upgrading its vault before it can be given access to anything.
/// </summary>
INVITE_RECIPIENT_NOT_READY,
+ /// <summary>
+ /// The shared manifest's key was rotated after the offer of access was made, so the key sealed into the offer no
+ /// longer opens the vault. The offer is closed and the inviter has to make a fresh one.
+ /// </summary>
+ INVITATION_KEY_OUTDATED,
+
/// <summary>
/// The client action does not exist, or is not addressed to the caller.
/// </summary>
diff --git a/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.cs b/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.cs
index 9d9ff74fc..15a997b8e 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/Enums/AuthEventType.cs
@@ -63,12 +63,12 @@ public enum AuthEventType
Register = 30,
/// <summary>
- /// Represents creation of a shared vault.
+ /// Represents creation of a shared manifest.
/// </summary>
SharedVaultCreation = 50,
/// <summary>
- /// Represents deletion of a shared vault, confirmed with the master password.
+ /// Represents deletion of a shared manifest, confirmed with the master password.
/// </summary>
SharedVaultDeletion = 51,
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.cs
index a630242c7..fe553ccb0 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestRequest.cs
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.V2.Groups;
/// <summary>
-/// Request for POST /v2/Groups/{groupId}/manifests: create another shared vault for the group.
+/// Request for POST /v2/Groups/{groupId}/manifests: create another shared manifest for the group.
/// </summary>
public class CreateSharedManifestRequest
{
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestResponse.cs
index 3970d0f97..4b40d9cec 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestResponse.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/CreateSharedManifestResponse.cs
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.V2.Groups;
/// <summary>
-/// Response for POST /v2/Groups/{groupId}/manifests. Identifies the newly created shared vault.
+/// Response for POST /v2/Groups/{groupId}/manifests. Identifies the newly created shared manifest.
/// </summary>
public class CreateSharedManifestResponse
{
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupInfo.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupInfo.cs
index 0e7695be2..2058c769f 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupInfo.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupInfo.cs
@@ -23,7 +23,7 @@ public class GroupInfo
public required string Role { get; set; }
/// <summary>
- /// Gets or sets the group's shared vaults. A group holds any number of them.
+ /// Gets or sets the group's shared manifests. A group holds any number of them.
/// </summary>
public List<SharedManifestInfo> Manifests { get; set; } = [];
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupOverviewResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupOverviewResponse.cs
index 7c0a9b9c2..33c312e25 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupOverviewResponse.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/GroupOverviewResponse.cs
@@ -18,7 +18,7 @@ public class GroupOverviewResponse
public List<GroupInfo> Groups { get; set; } = [];
/// <summary>
- /// Gets or sets the offers of access to a shared vault addressed to the caller, awaiting their accept or decline.
+ /// Gets or sets the offers of access to a shared manifest addressed to the caller, awaiting their accept or decline.
/// </summary>
public List<ReceivedManifestInvitation> ReceivedInvitations { get; set; } = [];
}
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/ReceivedManifestInvitation.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/ReceivedManifestInvitation.cs
index 99a5d82b8..0eccb9b72 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/ReceivedManifestInvitation.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/ReceivedManifestInvitation.cs
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.V2.Groups;
/// <summary>
-/// An open offer of access to a shared vault, addressed to the caller.
+/// An open offer of access to a shared manifest, addressed to the caller.
/// </summary>
public class ReceivedManifestInvitation
{
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SentManifestInvitation.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SentManifestInvitation.cs
index 1eb430df8..fbdd38e67 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SentManifestInvitation.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SentManifestInvitation.cs
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.V2.Groups;
/// <summary>
-/// An offer of access to a shared vault that is still awaiting the recipient's answer.
+/// An offer of access to a shared manifest that is still awaiting the recipient's answer.
/// </summary>
public class SentManifestInvitation
{
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SharedManifestInfo.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SharedManifestInfo.cs
index f02b0ee99..05ae67336 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SharedManifestInfo.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Groups/SharedManifestInfo.cs
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.V2.Groups;
/// <summary>
-/// One shared vault owned by a group. A group holds any number of these, each with its own key and its own set of
+/// One shared manifest owned by a group. A group holds any number of these, each with its own key and its own set of
/// members that were given access to it.
/// </summary>
public class SharedManifestInfo
diff --git a/core/models/src/webapi/AuthEventType.ts b/core/models/src/webapi/AuthEventType.ts
index 04f670702..b535bd531 100644
--- a/core/models/src/webapi/AuthEventType.ts
+++ b/core/models/src/webapi/AuthEventType.ts
@@ -53,12 +53,12 @@ export enum AuthEventType {
Register = 30,
/**
- * Represents creation of a shared vault.
+ * Represents creation of a shared manifest.
*/
SharedVaultCreation = 50,
/**
- * Represents deletion of a shared vault, confirmed with the master password.
+ * Represents deletion of a shared manifest, confirmed with the master password.
*/
SharedVaultDeletion = 51,
diff --git a/core/models/src/webapi/CapabilityKeys.ts b/core/models/src/webapi/CapabilityKeys.ts
index 74b03224f..e4573d40a 100644
--- a/core/models/src/webapi/CapabilityKeys.ts
+++ b/core/models/src/webapi/CapabilityKeys.ts
@@ -5,7 +5,7 @@
*/
export const CapabilityKeys = {
/**
- * Shared vaults: creating one, inviting people to it, and accepting an invitation to one. The capability
+ * Shared manifests: creating one, inviting people to it, and accepting an invitation to one. The capability
* behind the Family Sharing screens, and behind anything else built on a vault more than one account holds.
*/
VaultSharing: 'vault-sharing',
diff --git a/core/models/src/webapi/Groups.ts b/core/models/src/webapi/Groups.ts
index bc544397b..fb72fd3c2 100644
--- a/core/models/src/webapi/Groups.ts
+++ b/core/models/src/webapi/Groups.ts
@@ -21,7 +21,7 @@ export type GroupMemberInfo = {
}
/**
- * An offer of access to a shared vault that is still awaiting the recipient's answer.
+ * An offer of access to a shared manifest that is still awaiting the recipient's answer.
*/
export type SentManifestInvitation = {
id: string;
@@ -31,7 +31,7 @@ export type SentManifestInvitation = {
}
/**
- * An open offer of access to a shared vault, addressed to this user.
+ * An open offer of access to a shared manifest, addressed to this user.
*/
export type ReceivedManifestInvitation = {
id: string;
@@ -44,7 +44,7 @@ export type ReceivedManifestInvitation = {
}
/**
- * One shared vault owned by a group, with the members who can open it.
+ * One shared manifest owned by a group, with the members who can open it.
*/
export type SharedManifestInfo = {
manifestId: string;
@@ -71,7 +71,7 @@ export type GroupOverviewResponse = {
}
/**
- * Create another shared vault for a group.
+ * Create another shared manifest for a group.
*/
export type CreateSharedManifestRequest = {
manifestId: string;
@@ -89,7 +89,7 @@ export type CreateSharedManifestResponse = {
}
/**
- * One recipient's copy of a shared vault's VEK, encrypted for a public key of theirs.
+ * One recipient's copy of a shared manifest's VEK, encrypted for a public key of theirs.
*/
export type ManifestGrant = {
recipientUserId: string;
@@ -99,7 +99,7 @@ export type ManifestGrant = {
}
/**
- * Give a member of the group access to one of its shared vaults.
+ * Give a member of the group access to one of its shared manifests.
*/
export type GrantManifestAccessRequest = {
userId: string;
@@ -126,7 +126,7 @@ export type DeleteSharedManifestInitiateResponse = {
}
/**
- * Delete a shared vault for good, carrying the SRP proof of the caller's master password.
+ * Delete a shared manifest for good, carrying the SRP proof of the caller's master password.
*/
export type DeleteSharedManifestRequest = {
clientPublicEphemeral: string;