Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update PasswordChangeRequest.ts model (#2159)
Leendert de Borst7c89142e29c9
diff --git a/apps/browser-extension/src/utils/dist/core/models/webapi/index.d.ts b/apps/browser-extension/src/utils/dist/core/models/webapi/index.d.tsindex 18951f9ce..7213c1f17 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@@ -357,6 +357,20 @@ type PasswordChangeInitiateResponse = {srpIdentity?: string;};+/**+ * Request for POST /v2/Auth/change-password: new SRP credentials plus the Account Key rewrapped with the+ * KEK derived from the new password. A v2 password change touches no vault data (AK, VEK and grants are unchanged).+ */+type PasswordChangeRequest = {+ currentClientPublicEphemeral: string;+ currentClientSessionProof: string;+ newPasswordSalt: string;+ newPasswordVerifier: string;+ newEncryptedAccountKey: string;+ newEncryptionType: string;+ newEncryptionSettings: string;+};+/*** Represents a request to change the users password including a new vault that is encrypted with the new password.*/@@ -694,4 +708,4 @@ type CapabilityKey = typeof CapabilityKeys[keyof typeof CapabilityKeys];*/declare function isCapabilityEnabled(value: string | undefined): boolean;-export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type BucketRevision, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type DeleteSharedManifestInitiateResponse, type DeleteSharedManifestRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type PendingClientAction, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };+export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type BucketRevision, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type DeleteSharedManifestInitiateResponse, type DeleteSharedManifestRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type PasswordChangeRequest, type PendingClientAction, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };diff --git a/apps/mobile-app/utils/dist/core/models/webapi/index.d.ts b/apps/mobile-app/utils/dist/core/models/webapi/index.d.tsindex 18951f9ce..7213c1f17 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@@ -357,6 +357,20 @@ type PasswordChangeInitiateResponse = {srpIdentity?: string;};+/**+ * Request for POST /v2/Auth/change-password: new SRP credentials plus the Account Key rewrapped with the+ * KEK derived from the new password. A v2 password change touches no vault data (AK, VEK and grants are unchanged).+ */+type PasswordChangeRequest = {+ currentClientPublicEphemeral: string;+ currentClientSessionProof: string;+ newPasswordSalt: string;+ newPasswordVerifier: string;+ newEncryptedAccountKey: string;+ newEncryptionType: string;+ newEncryptionSettings: string;+};+/*** Represents a request to change the users password including a new vault that is encrypted with the new password.*/@@ -694,4 +708,4 @@ type CapabilityKey = typeof CapabilityKeys[keyof typeof CapabilityKeys];*/declare function isCapabilityEnabled(value: string | undefined): boolean;-export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type BucketRevision, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type DeleteSharedManifestInitiateResponse, type DeleteSharedManifestRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type PendingClientAction, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };+export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type BucketRevision, type CapabilityKey, CapabilityKeys, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type DeleteSharedManifestInitiateResponse, type DeleteSharedManifestRequest, type Email, type EmailAttachment, type EmailDecryptionKey, type FaviconExtractModel, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupInfo, type GroupMemberInfo, type GroupOverviewResponse, type GroupRole, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type ManifestGrant, ManifestKeyType, type ManifestKeyTypeValue, type ManifestRevision, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type PasswordChangeRequest, type PendingClientAction, type ReceivedManifestInvitation, type RefreshToken, type SentManifestInvitation, type SharedManifestInfo, type StatusResponse, type StatusResponseV2, type TokenModel, UnlockMethodType, type UnlockMethodTypeValue, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, VaultKeyAlgorithm, type VaultKeyAlgorithmValue, type VaultKeyGetResponse, type VaultKeyResponse, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse, isCapabilityEnabled };diff --git a/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs b/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.csindex 47b687ece..0484769ef 100644--- a/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs+++ b/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs@@ -262,4 +262,9 @@ public enum ApiErrorCode/// The capability the request needs is not enabled for this account on this server./// </summary>CAPABILITY_NOT_AVAILABLE,++ /// <summary>+ /// The supplied KEK derivation parameters are not within expected bounds.+ /// </summary>+ INVALID_ENCRYPTION_PARAMETERS,}diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Auth/PasswordChangeRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Auth/PasswordChangeRequest.csindex 28685d596..d62501816 100644--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Auth/PasswordChangeRequest.cs+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Auth/PasswordChangeRequest.cs@@ -8,8 +8,8 @@namespace AliasVault.Shared.Models.WebApi.V2.Auth;/// <summary>-/// Request for POST /v2/Auth/change-password. Carries the new SRP credentials plus the VEK re-encrypted-/// with the new password-derived KEK.+/// Request for POST /v2/Auth/change-password. Carries the new SRP credentials plus the Account Key+/// re-encrypted with the new password-derived KEK./// </summary>public class PasswordChangeRequest{@@ -28,4 +28,10 @@ public class PasswordChangeRequest/// <summary>Gets or sets the Account Key rewrapped with the KEK derived from the new password. The VEK,/// account keypair and grants are untouched by a password change.</summary>public required string NewEncryptedAccountKey { get; set; }++ /// <summary>Gets or sets the KDF type the client derived the new KEK with (currently always Argon2Id).</summary>+ public required string NewEncryptionType { get; set; }++ /// <summary>Gets or sets the KDF settings JSON the client derived the new KEK with.</summary>+ public required string NewEncryptionSettings { get; set; }}diff --git a/core/models/src/webapi/PasswordChangeRequest.ts b/core/models/src/webapi/PasswordChangeRequest.tsnew file mode 100644index 000000000..2e624144c--- /dev/null+++ b/core/models/src/webapi/PasswordChangeRequest.ts@@ -0,0 +1,12 @@+/**+ * Request for POST /v2/Auth/change-password.+ */+export type PasswordChangeRequest = {+ currentClientPublicEphemeral: string;+ currentClientSessionProof: string;+ newPasswordSalt: string;+ newPasswordVerifier: string;+ newEncryptedAccountKey: string;+ newEncryptionType: string;+ newEncryptionSettings: string;+};diff --git a/core/models/src/webapi/index.ts b/core/models/src/webapi/index.tsindex e5cff2842..68016b81b 100644--- a/core/models/src/webapi/index.ts+++ b/core/models/src/webapi/index.ts@@ -20,6 +20,7 @@ export * from './FaviconExtractModel';export * from './DeleteAccountInitiate';export * from './DeleteAccountRequest';export * from './PasswordChangeInitiateResponse';+export * from './PasswordChangeRequest';export * from './VaultPasswordChangeRequest';export * from './BadRequestResponse';export * from './AuthEventType';