mirror of
https://github.com/bitwarden/cli
synced 2025-12-16 16:23:30 +00:00
enforce policies on generate command (#115)
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 3d2e2cb174...44b86f5dd0
@@ -119,7 +119,8 @@ export class Main {
|
|||||||
this.folderService, this.cipherService, this.cryptoService, this.collectionService,
|
this.folderService, this.cipherService, this.cryptoService, this.collectionService,
|
||||||
this.storageService, this.messagingService, this.policyService,
|
this.storageService, this.messagingService, this.policyService,
|
||||||
async (expired: boolean) => await this.logout());
|
async (expired: boolean) => await this.logout());
|
||||||
this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService);
|
this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService,
|
||||||
|
this.policyService);
|
||||||
this.totpService = new TotpService(this.storageService, this.cryptoFunctionService);
|
this.totpService = new TotpService(this.storageService, this.cryptoFunctionService);
|
||||||
this.importService = new ImportService(this.cipherService, this.folderService, this.apiService,
|
this.importService = new ImportService(this.cipherService, this.folderService, this.apiService,
|
||||||
this.i18nService, this.collectionService);
|
this.i18nService, this.collectionService);
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ export class GenerateCommand {
|
|||||||
} else if (options.wordSeparator != null && options.wordSeparator.length > 1) {
|
} else if (options.wordSeparator != null && options.wordSeparator.length > 1) {
|
||||||
options.wordSeparator = options.wordSeparator[0];
|
options.wordSeparator = options.wordSeparator[0];
|
||||||
}
|
}
|
||||||
const password = await this.passwordGenerationService.generatePassword(options);
|
const enforcedOptions = await this.passwordGenerationService.enforcePasswordGeneratorPoliciesOnOptions(options);
|
||||||
|
const password = await this.passwordGenerationService.generatePassword(enforcedOptions[0]);
|
||||||
const res = new StringResponse(password);
|
const res = new StringResponse(password);
|
||||||
return Response.success(res);
|
return Response.success(res);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user