mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-25918] Move required userId for export request up to component/command level (#14391)
* Require userId for KdfConfigService * cleanup KdfConfigService unit tests * Move required userId for export request up to component/command level * Fix service creation/dependency injection * Revert changes to kdf-config.service.spec cause by a bad rebase * Fix linting issue * Fix tests caused by bad rebase * Validate provided userId to equal the current active user * Create tests for vault-export.service Deleted old tests which since have been replaced with individual-vault-export.service.spec.ts --------- Co-authored-by: Thomas Avery <tavery@bitwarden.com> Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a77fb354d8
commit
94764467e8
@@ -1097,7 +1097,6 @@ export default class MainBackground {
|
||||
this.encryptService,
|
||||
this.cryptoFunctionService,
|
||||
this.kdfConfigService,
|
||||
this.accountService,
|
||||
this.apiService,
|
||||
this.restrictedItemTypesService,
|
||||
);
|
||||
@@ -1113,13 +1112,13 @@ export default class MainBackground {
|
||||
this.cryptoFunctionService,
|
||||
this.collectionService,
|
||||
this.kdfConfigService,
|
||||
this.accountService,
|
||||
this.restrictedItemTypesService,
|
||||
);
|
||||
|
||||
this.exportService = new VaultExportService(
|
||||
this.individualVaultExportService,
|
||||
this.organizationVaultExportService,
|
||||
this.accountService,
|
||||
);
|
||||
|
||||
this.browserInitialInstallService = new BrowserInitialInstallService(this.stateProvider);
|
||||
|
||||
@@ -841,7 +841,6 @@ export class ServiceContainer {
|
||||
this.encryptService,
|
||||
this.cryptoFunctionService,
|
||||
this.kdfConfigService,
|
||||
this.accountService,
|
||||
this.apiService,
|
||||
this.restrictedItemTypesService,
|
||||
);
|
||||
@@ -857,13 +856,13 @@ export class ServiceContainer {
|
||||
this.cryptoFunctionService,
|
||||
this.collectionService,
|
||||
this.kdfConfigService,
|
||||
this.accountService,
|
||||
this.restrictedItemTypesService,
|
||||
);
|
||||
|
||||
this.exportService = new VaultExportService(
|
||||
this.individualExportService,
|
||||
this.organizationExportService,
|
||||
this.accountService,
|
||||
);
|
||||
|
||||
this.userAutoUnlockKeyService = new UserAutoUnlockKeyService(this.keyService);
|
||||
|
||||
@@ -70,10 +70,13 @@ export class ExportCommand {
|
||||
password = await this.promptPassword(password);
|
||||
}
|
||||
|
||||
const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||
|
||||
exportContent =
|
||||
options.organizationid == null
|
||||
? await this.exportService.getExport(format, password)
|
||||
? await this.exportService.getExport(userId, format, password)
|
||||
: await this.exportService.getOrganizationExport(
|
||||
userId,
|
||||
options.organizationid,
|
||||
format,
|
||||
password,
|
||||
|
||||
Reference in New Issue
Block a user