1
0
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:
Daniel James Smith
2025-09-19 13:39:55 +02:00
committed by GitHub
parent a77fb354d8
commit 94764467e8
14 changed files with 220 additions and 387 deletions

View File

@@ -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);

View File

@@ -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,