From e6b2ec4c56a0a3407c7321c3a3935a4330522e69 Mon Sep 17 00:00:00 2001 From: Todd Martin Date: Tue, 6 Jan 2026 14:59:47 -0500 Subject: [PATCH] Consolidate deprecation message and instructions. --- .../key-management/src/abstractions/key.service.ts | 6 +++--- libs/key-management/src/key.service.ts | 14 -------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/libs/key-management/src/abstractions/key.service.ts b/libs/key-management/src/abstractions/key.service.ts index feb4a38ac27..b5333661689 100644 --- a/libs/key-management/src/abstractions/key.service.ts +++ b/libs/key-management/src/abstractions/key.service.ts @@ -158,7 +158,7 @@ export abstract class KeyService { abstract getOrDeriveMasterKey(password: string, userId: UserId): Promise; /** * Generates a master key from the provided password - * @deprecated Interacting with the master key directly is prohibited. + * @deprecated Please use `makeMasterPasswordAuthenticationData`, `unwrapUserKeyFromMasterPasswordUnlockData` or `makeMasterPasswordUnlockData` in MasterPasswordService instead. * @param password The user's master password * @param email The user's email * @param KdfConfig The user's key derivation function configuration @@ -167,7 +167,7 @@ export abstract class KeyService { abstract makeMasterKey(password: string, email: string, kdfConfig: KdfConfig): Promise; /** * Encrypts the provided user key with the provided master key. - * @deprecated Interacting with the master key directly is prohibited. Use a high level function from MasterPasswordService instead. + * @deprecated Please use `makeMasterPasswordUnlockData` in {@link MasterPasswordService} instead. * @param masterKey The user's master key * @param userKey The user key * @throws Error when userKey or masterKey is null/undefined. @@ -181,7 +181,7 @@ export abstract class KeyService { * Creates a master password hash from the user's master password. Can * be used for local authentication or for server authentication depending * on the hashPurpose provided. - * @deprecated Interacting with the master key directly is prohibited. Use a high level function from MasterPasswordService instead. + * @deprecated Please use `makeMasterPasswordAuthenticationData` in {@link MasterPasswordService} instead. * @param password The user's master password * @param key The user's master key or active's user master key. * @param hashPurpose The iterations to use for the hash. Defaults to {@link HashPurpose.ServerAuthorization}. diff --git a/libs/key-management/src/key.service.ts b/libs/key-management/src/key.service.ts index 621a8135d1e..a691a6a4649 100644 --- a/libs/key-management/src/key.service.ts +++ b/libs/key-management/src/key.service.ts @@ -168,9 +168,6 @@ export class DefaultKeyService implements KeyServiceAbstraction { return this.stateProvider.getUserState$(USER_KEY, userId); } - /** - * @deprecated Use {@link userKey$} with a required {@link UserId} instead. - */ async getUserKey(userId?: UserId): Promise { const userKey = await firstValueFrom(this.stateProvider.getUserState$(USER_KEY, userId)); return userKey; @@ -248,9 +245,6 @@ export class DefaultKeyService implements KeyServiceAbstraction { await this.stateService.setUserKeyAutoUnlock(null, { userId: userId }); } - /** - * @deprecated Please use `makeMasterPasswordAuthenticationData`, `unwrapUserKeyFromMasterPasswordUnlockData` or `makeMasterPasswordUnlockData` in @link MasterPasswordService instead. - */ async getOrDeriveMasterKey(password: string, userId: UserId): Promise { if (userId == null) { throw new Error("User ID is required."); @@ -279,8 +273,6 @@ export class DefaultKeyService implements KeyServiceAbstraction { /** * Derive a master key from a password and email. * - * @deprecated Please use `makeMasterPasswordAuthenticationData`, `makeMasterPasswordAuthenticationData`, `unwrapUserKeyFromMasterPasswordUnlockData` in @link MasterPasswordService instead. - * * @remarks * Does not validate the kdf config to ensure it satisfies the minimum requirements for the given kdf type. */ @@ -298,9 +290,6 @@ export class DefaultKeyService implements KeyServiceAbstraction { return masterKey; } - /** - * @deprecated Please use `makeMasterPasswordUnlockData` in {@link MasterPasswordService} instead. - */ async encryptUserKeyWithMasterKey( masterKey: MasterKey, userKey: UserKey, @@ -315,9 +304,6 @@ export class DefaultKeyService implements KeyServiceAbstraction { return await this.buildProtectedSymmetricKey(masterKey, userKey); } - /** - * @deprecated Please use `makeMasterPasswordAuthenticationData` in {@link MasterPasswordService} instead. - */ async hashMasterKey( password: string, key: MasterKey,