mirror of
https://github.com/bitwarden/browser
synced 2026-02-27 10:03:23 +00:00
Consolidate deprecation message and instructions.
This commit is contained in:
@@ -158,7 +158,7 @@ export abstract class KeyService {
|
||||
abstract getOrDeriveMasterKey(password: string, userId: UserId): Promise<MasterKey>;
|
||||
/**
|
||||
* 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<MasterKey>;
|
||||
/**
|
||||
* 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}.
|
||||
|
||||
@@ -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<UserKey> {
|
||||
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<MasterKey> {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user