From f85a6958bc2e2935eab0f1ff8b89085991624138 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 16 Nov 2021 20:50:58 +1000 Subject: [PATCH] Update jslib and service dependencies (#2179) * Update service deps * Fix linting * Update jslib --- jslib | 2 +- src/background/main.background.ts | 8 +++++++- src/popup/services/services.module.ts | 9 ++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/jslib b/jslib index e02e663ce1..720967475b 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit e02e663ce1aed94d42db00dcdb2e42bdd625f0dc +Subproject commit 720967475b37d635c18a1eb74bb3702445647b4d diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 11ebc51f85..84b29b4e4a 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -30,6 +30,7 @@ import { SystemService } from 'jslib-common/services/system.service'; import { TokenService } from 'jslib-common/services/token.service'; import { TotpService } from 'jslib-common/services/totp.service'; import { UserService } from 'jslib-common/services/user.service'; +import { UserVerificationService } from 'jslib-common/services/userVerification.service'; import { WebCryptoFunctionService } from 'jslib-common/services/webCryptoFunction.service'; import { ApiService as ApiServiceAbstraction } from 'jslib-common/abstractions/api.service'; @@ -63,7 +64,9 @@ import { SystemService as SystemServiceAbstraction } from 'jslib-common/abstract import { TokenService as TokenServiceAbstraction } from 'jslib-common/abstractions/token.service'; import { TotpService as TotpServiceAbstraction } from 'jslib-common/abstractions/totp.service'; import { UserService as UserServiceAbstraction } from 'jslib-common/abstractions/user.service'; +import { UserVerificationService as UserVerificationServiceAbstraction } from 'jslib-common/abstractions/userVerification.service'; import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from 'jslib-common/abstractions/vaultTimeout.service'; + import { AutofillService as AutofillServiceAbstraction } from '../services/abstractions/autofill.service'; import { BrowserApi } from '../browser/browserApi'; @@ -126,6 +129,7 @@ export default class MainBackground { sendService: SendServiceAbstraction; fileUploadService: FileUploadServiceAbstraction; keyConnectorService: KeyConnectorServiceAbstraction; + userVerificationService: UserVerificationServiceAbstraction; onUpdatedRan: boolean; onReplacedRan: boolean; @@ -197,7 +201,7 @@ export default class MainBackground { this.stateService = new StateService(); this.policyService = new PolicyService(this.userService, this.storageService, this.apiService); this.keyConnectorService = new KeyConnectorService(this.storageService, this.userService, this.cryptoService, - this.apiService, this.environmentService, this.tokenService, this.logService); + this.apiService, this.tokenService, this.logService); this.vaultTimeoutService = new VaultTimeoutService(this.cipherService, this.folderService, this.collectionService, this.cryptoService, this.platformUtilsService, this.storageService, this.messagingService, this.searchService, this.userService, this.tokenService, this.policyService, @@ -239,6 +243,8 @@ export default class MainBackground { BrowserApi.reloadExtension(forceWindowReload ? window : null); return Promise.resolve(); }); + this.userVerificationService = new UserVerificationService(this.cryptoService, this.i18nService, + this.apiService); // Other fields this.isSafari = this.platformUtilsService.isSafari(); diff --git a/src/popup/services/services.module.ts b/src/popup/services/services.module.ts index 3a1c84be61..c278076f04 100644 --- a/src/popup/services/services.module.ts +++ b/src/popup/services/services.module.ts @@ -50,7 +50,7 @@ import { SyncService } from 'jslib-common/abstractions/sync.service'; import { TokenService } from 'jslib-common/abstractions/token.service'; import { TotpService } from 'jslib-common/abstractions/totp.service'; import { UserService } from 'jslib-common/abstractions/user.service'; -import { UserVerificationService as UserVerificationServiceAbstraction } from 'jslib-common/abstractions/userVerification.service'; +import { UserVerificationService } from 'jslib-common/abstractions/userVerification.service'; import { VaultTimeoutService } from 'jslib-common/abstractions/vaultTimeout.service'; import { AutofillService } from '../../services/abstractions/autofill.service'; @@ -61,7 +61,6 @@ import { ConsoleLogService } from 'jslib-common/services/consoleLog.service'; import { ConstantsService } from 'jslib-common/services/constants.service'; import { SearchService } from 'jslib-common/services/search.service'; import { StateService } from 'jslib-common/services/state.service'; -import { UserVerificationService } from 'jslib-common/services/userVerification.service'; import { PopupSearchService } from './popup-search.service'; import { PopupUtilsService } from './popup-utils.service'; @@ -186,6 +185,11 @@ export function initFactory(platformUtilsService: PlatformUtilsService, i18nServ { provide: ExportService, useFactory: getBgService('exportService'), deps: [] }, { provide: SendService, useFactory: getBgService('sendService'), deps: [] }, { provide: KeyConnectorService, useFactory: getBgService('keyConnectorService'), deps: [] }, + { + provide: UserVerificationService, + useFactory: getBgService('userVerificationService'), + deps: [], + }, { provide: VaultTimeoutService, useFactory: getBgService('vaultTimeoutService'), @@ -208,7 +212,6 @@ export function initFactory(platformUtilsService: PlatformUtilsService, i18nServ deps: [], }, { provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService }, - { provide: UserVerificationServiceAbstraction, useClass: UserVerificationService }, ], }) export class ServicesModule {