1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 11:43:46 +00:00

username generator (#2468)

* username generator

* pass usernameWebsite

* update jslib ref

* update jslib ref

* update jslib ref

* update jslib ref

* Update jslib to point to jslib master

* Updated package-lock.json after running npm i

* add missing translations

* pr feedback

Co-authored-by: Daniel James Smith <djsmith@web.de>
This commit is contained in:
Kyle Spearrin
2022-03-30 17:59:58 -04:00
committed by GitHub
parent 4607e9d0ba
commit bf081e0322
12 changed files with 532 additions and 191 deletions

View File

@@ -31,6 +31,7 @@ import { TokenService as TokenServiceAbstraction } from "jslib-common/abstractio
import { TotpService as TotpServiceAbstraction } from "jslib-common/abstractions/totp.service";
import { TwoFactorService as TwoFactorServiceAbstraction } from "jslib-common/abstractions/twoFactor.service";
import { UserVerificationService as UserVerificationServiceAbstraction } from "jslib-common/abstractions/userVerification.service";
import { UsernameGenerationService as UsernameGenerationServiceAbstraction } from "jslib-common/abstractions/usernameGeneration.service";
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-common/abstractions/vaultTimeout.service";
import { CipherRepromptType } from "jslib-common/enums/cipherRepromptType";
import { CipherType } from "jslib-common/enums/cipherType";
@@ -66,6 +67,7 @@ import { TokenService } from "jslib-common/services/token.service";
import { TotpService } from "jslib-common/services/totp.service";
import { TwoFactorService } from "jslib-common/services/twoFactor.service";
import { UserVerificationService } from "jslib-common/services/userVerification.service";
import { UsernameGenerationService } from "jslib-common/services/usernameGeneration.service";
import { WebCryptoFunctionService } from "jslib-common/services/webCryptoFunction.service";
import { BrowserApi } from "../browser/browserApi";
@@ -136,6 +138,7 @@ export default class MainBackground {
keyConnectorService: KeyConnectorServiceAbstraction;
userVerificationService: UserVerificationServiceAbstraction;
twoFactorService: TwoFactorServiceAbstraction;
usernameGenerationService: UsernameGenerationServiceAbstraction;
onUpdatedRan: boolean;
onReplacedRan: boolean;
@@ -200,7 +203,7 @@ export default class MainBackground {
}
);
this.i18nService = new I18nService(BrowserApi.getUILanguage(window));
this.cryptoFunctionService = new WebCryptoFunctionService(window, this.platformUtilsService);
this.cryptoFunctionService = new WebCryptoFunctionService(window);
this.cryptoService = new BrowserCryptoService(
this.cryptoFunctionService,
this.platformUtilsService,
@@ -475,6 +478,10 @@ export default class MainBackground {
this.twoFactorService,
this.i18nService
);
this.usernameGenerationService = new UsernameGenerationService(
this.cryptoService,
this.stateService
);
}
async bootstrap() {