1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

[PM-23614] Remove activeUserOrgKeys$ from the key service (#17045)

* Remove activeUserOrgKeys$ from the key service

* test leftover

* test leftover
This commit is contained in:
Maciej Zieniuk
2025-11-06 19:27:13 +01:00
committed by GitHub
parent c404ee210b
commit ff12e672e6
7 changed files with 42 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import * as papa from "papaparse";
import { firstValueFrom, map } from "rxjs";
import { filter, firstValueFrom, map } from "rxjs";
import {
CollectionService,
@@ -137,6 +137,10 @@ export class OrganizationVaultExportService
const decCiphers: CipherView[] = [];
const promises = [];
const orgKeys = await firstValueFrom(
this.keyService.orgKeys$(activeUserId).pipe(filter((orgKeys) => orgKeys != null)),
);
const restrictions = await firstValueFrom(this.restrictedItemTypesService.restricted$);
promises.push(
@@ -148,12 +152,11 @@ export class OrganizationVaultExportService
const collection = Collection.fromCollectionData(
new CollectionData(c as CollectionDetailsResponse),
);
const orgKey = orgKeys[organizationId];
exportPromises.push(
firstValueFrom(this.keyService.activeUserOrgKeys$)
.then((keys) => collection.decrypt(keys[organizationId], this.encryptService))
.then((decCol) => {
decCollections.push(decCol);
}),
collection.decrypt(orgKey, this.encryptService).then((decCol) => {
decCollections.push(decCol);
}),
);
});
}