From f7f70408c9adce38d0ee2e65b89192ac616754d9 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 28 Jan 2020 22:42:20 -0500 Subject: [PATCH] update jslib and construct policy service --- jslib | 2 +- src/app/app.component.ts | 5 ++++- src/app/services/services.module.ts | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/jslib b/jslib index dce1453732..3d2e2cb174 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit dce1453732553d991ac910e3a93038f7331c8ab9 +Subproject commit 3d2e2cb1741be8b7b2916574f62f7ba2193c7123 diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 027efe05fb..106c897d6e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -40,6 +40,7 @@ import { LockService } from 'jslib/abstractions/lock.service'; import { NotificationsService } from 'jslib/abstractions/notifications.service'; import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; +import { PolicyService } from 'jslib/abstractions/policy.service'; import { SearchService } from 'jslib/abstractions/search.service'; import { SettingsService } from 'jslib/abstractions/settings.service'; import { StateService } from 'jslib/abstractions/state.service'; @@ -84,7 +85,8 @@ export class AppComponent implements OnDestroy, OnInit { private cryptoService: CryptoService, private collectionService: CollectionService, private sanitizer: DomSanitizer, private searchService: SearchService, private notificationsService: NotificationsService, private routerService: RouterService, - private stateService: StateService, private eventService: EventService) { } + private stateService: StateService, private eventService: EventService, + private policyService: PolicyService) { } ngOnInit() { this.ngZone.runOutsideAngular(() => { @@ -187,6 +189,7 @@ export class AppComponent implements OnDestroy, OnInit { this.cipherService.clear(userId), this.folderService.clear(userId), this.collectionService.clear(userId), + this.policyService.clear(userId), this.passwordGenerationService.clear(), this.stateService.purge(), ]); diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index a92bf70cc8..3b5f729180 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -41,6 +41,7 @@ import { ImportService } from 'jslib/services/import.service'; import { LockService } from 'jslib/services/lock.service'; import { NotificationsService } from 'jslib/services/notifications.service'; import { PasswordGenerationService } from 'jslib/services/passwordGeneration.service'; +import { PolicyService } from 'jslib/services/policy.service'; import { SearchService } from 'jslib/services/search.service'; import { SettingsService } from 'jslib/services/settings.service'; import { StateService } from 'jslib/services/state.service'; @@ -72,6 +73,7 @@ import { PasswordGenerationService as PasswordGenerationServiceAbstraction, } from 'jslib/abstractions/passwordGeneration.service'; import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from 'jslib/abstractions/platformUtils.service'; +import { PolicyService as PolicyServiceAbstraction } from 'jslib/abstractions/policy.service'; import { SearchService as SearchServiceAbstraction } from 'jslib/abstractions/search.service'; import { SettingsService as SettingsServiceAbstraction } from 'jslib/abstractions/settings.service'; import { StateService as StateServiceAbstraction } from 'jslib/abstractions/state.service'; @@ -105,10 +107,11 @@ const folderService = new FolderService(cryptoService, userService, apiService, i18nService, cipherService); const collectionService = new CollectionService(cryptoService, userService, storageService, i18nService); searchService = new SearchService(cipherService, platformUtilsService); +const policyService = new PolicyService(userService, storageService); const lockService = new LockService(cipherService, folderService, collectionService, cryptoService, platformUtilsService, storageService, messagingService, searchService, userService, null); const syncService = new SyncService(userService, apiService, settingsService, - folderService, cipherService, cryptoService, collectionService, storageService, messagingService, + folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService, async (expired: boolean) => messagingService.send('logout', { expired: expired })); const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService); const totpService = new TotpService(storageService, cryptoFunctionService); @@ -211,6 +214,7 @@ export function initFactory(): Function { { provide: NotificationsServiceAbstraction, useValue: notificationsService }, { provide: CryptoFunctionServiceAbstraction, useValue: cryptoFunctionService }, { provide: EventLoggingServiceAbstraction, useValue: eventLoggingService }, + { provide: PolicyServiceAbstraction, useValue: policyService }, { provide: APP_INITIALIZER, useFactory: initFactory,