mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
[PM-27591] Remove orgid in vault decryption code (#17099)
* Remove orgid in vault decryption code * Remove folder usage without provided key * Fix folder test * Fix build * Fix build * Fix build * Fix tests * Update spec to not use EncString decrypt * Fix tests * Fix test * Fix test * Remove comment * Remove org id parameter
This commit is contained in:
@@ -1564,10 +1564,15 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
}
|
||||
|
||||
async getKeyForCipherKeyDecryption(cipher: Cipher, userId: UserId): Promise<UserKey | OrgKey> {
|
||||
return (
|
||||
(await this.keyService.getOrgKey(cipher.organizationId)) ||
|
||||
((await this.keyService.getUserKey(userId)) as UserKey)
|
||||
);
|
||||
if (cipher.organizationId == null) {
|
||||
return await firstValueFrom(this.keyService.userKey$(userId));
|
||||
} else {
|
||||
return await firstValueFrom(
|
||||
this.keyService
|
||||
.orgKeys$(userId)
|
||||
.pipe(map((orgKeys) => orgKeys[cipher.organizationId as OrganizationId] as OrgKey)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async setAddEditCipherInfo(value: AddEditCipherInfo, userId: UserId) {
|
||||
|
||||
Reference in New Issue
Block a user