1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-12 22:44:11 +00:00

PM-14445: Removed some types overrides

This commit is contained in:
Maciej Zieniuk
2024-11-05 12:48:46 +00:00
parent b310fbcaa6
commit d287fc80f1
2 changed files with 7 additions and 7 deletions

View File

@@ -161,10 +161,10 @@ export abstract class KeyService {
/**
* Generates a new user key
* @param masterKey The user's master key
* @param key The user's master key
* @returns A new user key and the master key protected version of it
*/
abstract makeUserKey(key: MasterKey): Promise<[UserKey, EncString]>;
abstract makeUserKey(key: MasterKey | null): Promise<[UserKey, EncString]>;
/**
* Clears the user's stored version of the user key
@@ -178,7 +178,7 @@ export abstract class KeyService {
* @param userKeyMasterKey The master key encrypted user key to set
* @param userId The desired user
*/
abstract setMasterKeyEncryptedUserKey(UserKeyMasterKey: string, userId?: string): Promise<void>;
abstract setMasterKeyEncryptedUserKey(userKeyMasterKey: string, userId?: string): Promise<void>;
/**
* @param password The user's master password that will be used to derive a master key if one isn't found
@@ -254,7 +254,7 @@ export abstract class KeyService {
*
* @deprecated Use {@link orgKeys$} with a required {@link UserId} instead.
*/
abstract activeUserOrgKeys$: Observable<Record<OrganizationId, OrgKey>>;
abstract activeUserOrgKeys$: Observable<Record<OrganizationId, OrgKey> | null>;
/**
* Returns the organization's symmetric key

View File

@@ -65,7 +65,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
readonly everHadUserKey$: Observable<boolean>;
readonly activeUserOrgKeys$: Observable<Record<OrganizationId, OrgKey>>;
readonly activeUserOrgKeys$: Observable<Record<OrganizationId, OrgKey> | null>;
constructor(
protected pinService: PinServiceAbstraction,
@@ -86,7 +86,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
this.activeUserOrgKeys$ = this.stateProvider.activeUserId$.pipe(
switchMap((userId) => (userId != null ? this.orgKeys$(userId) : NEVER)),
) as Observable<Record<OrganizationId, OrgKey>>;
);
}
async setUserKey(key: UserKey | null, userId?: UserId): Promise<void> {
@@ -219,7 +219,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
return (await this.getKeyFromStorage(keySuffix, userId)) != null;
}
async makeUserKey(masterKey: MasterKey): Promise<[UserKey, EncString]> {
async makeUserKey(masterKey: MasterKey | null): Promise<[UserKey, EncString]> {
if (!masterKey) {
const userId = await firstValueFrom(this.stateProvider.activeUserId$);
if (userId == null) {