1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

[PM-21912] Require userID for KeyService's hasUserKey (#14890)

* Update keyService hasUserKey to require userId and remove unused/duplicate methods

* Update lock component consumer

* Update send commands to pass in userId

* update SSO login to pass in userID

* Update bw serve to pass in userID

* remove unneeded method from electron-key.service
This commit is contained in:
Thomas Avery
2025-07-09 11:53:16 -05:00
committed by GitHub
parent 9f1531a1b2
commit 09fb74679d
14 changed files with 66 additions and 75 deletions

View File

@@ -138,24 +138,13 @@ export abstract class KeyService {
userId: string,
): Promise<UserKey | null>;
/**
* Determines whether the user key is available for the given user.
* @param userId The desired user. If not provided, the active user will be used. If no active user exists, the method will return false.
* @returns True if the user key is available
*/
abstract hasUserKey(userId?: UserId): Promise<boolean>;
/**
* Determines whether the user key is available for the given user in memory.
* @param userId The desired user. If not provided, the active user will be used. If no active user exists, the method will return false.
* @returns True if the user key is available
* @param userId The desired user. If null or undefined, will return false.
* @returns True if the user key is available, returns false otherwise.
*/
abstract hasUserKeyInMemory(userId?: string): Promise<boolean>;
/**
* @param keySuffix The desired version of the user's key to check
* @param userId The desired user
* @returns True if the provided version of the user key is stored
*/
abstract hasUserKeyStored(keySuffix: KeySuffixOptions, userId?: string): Promise<boolean>;
abstract hasUserKey(userId: UserId): Promise<boolean>;
/**
* Generates a new user key
* @throws Error when master key is null and there is no active user