From d21cb02bd89e403f4a7bd82030d2eabe155d9ba1 Mon Sep 17 00:00:00 2001 From: Jacob Fink Date: Mon, 16 Oct 2023 13:39:40 -0400 Subject: [PATCH] fix imports --- apps/web/src/app/auth/auth.module.ts | 6 ++++-- apps/web/src/app/auth/core/core.module.ts | 3 +-- .../src/app/auth/core/services/emergency-access/index.ts | 1 + apps/web/src/app/auth/core/services/index.ts | 1 + .../services/webauthn-login/webauthn-login-api.service.ts | 2 +- .../core/services/webauthn-login/webauthn-login.service.ts | 2 +- .../app/auth/emergency-access/accept-emergency.component.ts | 2 +- .../migrate-legacy-encryption.service.spec.ts | 5 ++--- .../migrate-encryption/migrate-legacy-encryption.service.ts | 3 ++- apps/web/src/app/auth/settings/change-password.component.ts | 3 ++- .../emergency-access/emergency-access-add-edit.component.ts | 3 ++- .../emergency-access/emergency-access-takeover.component.ts | 2 +- .../emergency-access/emergency-access-view.component.ts | 3 ++- .../settings/emergency-access/emergency-access.component.ts | 2 +- 14 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 apps/web/src/app/auth/core/services/emergency-access/index.ts diff --git a/apps/web/src/app/auth/auth.module.ts b/apps/web/src/app/auth/auth.module.ts index 056b9f161f..97d13088b3 100644 --- a/apps/web/src/app/auth/auth.module.ts +++ b/apps/web/src/app/auth/auth.module.ts @@ -2,10 +2,12 @@ import { NgModule } from "@angular/core"; import { AuthSettingsModule } from "./settings/settings.module"; +import { CoreAuthModule } from "./core/core.module"; + @NgModule({ - imports: [AuthSettingsModule], + imports: [AuthSettingsModule, CoreAuthModule], declarations: [], providers: [], - exports: [AuthSettingsModule], + exports: [AuthSettingsModule, CoreAuthModule], }) export class AuthModule {} diff --git a/apps/web/src/app/auth/core/core.module.ts b/apps/web/src/app/auth/core/core.module.ts index 4863107b98..cf43367459 100644 --- a/apps/web/src/app/auth/core/core.module.ts +++ b/apps/web/src/app/auth/core/core.module.ts @@ -1,9 +1,8 @@ import { NgModule, Optional, SkipSelf } from "@angular/core"; +import { EmergencyAccessService, WebauthnLoginService } from "./services"; import { EmergencyAccessApiService } from "./services/emergency-access/emergency-access-api.service"; -import { EmergencyAccessService } from "./services/emergency-access/emergency-access.service"; import { WebauthnLoginApiService } from "./services/webauthn-login/webauthn-login-api.service"; -import { WebauthnLoginService } from "./services/webauthn-login/webauthn-login.service"; @NgModule({ providers: [ diff --git a/apps/web/src/app/auth/core/services/emergency-access/index.ts b/apps/web/src/app/auth/core/services/emergency-access/index.ts new file mode 100644 index 0000000000..9820b417a7 --- /dev/null +++ b/apps/web/src/app/auth/core/services/emergency-access/index.ts @@ -0,0 +1 @@ +export * from "./emergency-access.service"; diff --git a/apps/web/src/app/auth/core/services/index.ts b/apps/web/src/app/auth/core/services/index.ts index 4ef20f4b97..e763170983 100644 --- a/apps/web/src/app/auth/core/services/index.ts +++ b/apps/web/src/app/auth/core/services/index.ts @@ -1 +1,2 @@ +export * from "./emergency-access"; export * from "./webauthn-login"; diff --git a/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login-api.service.ts b/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login-api.service.ts index 6dc6156349..4a3a25d59e 100644 --- a/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login-api.service.ts +++ b/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login-api.service.ts @@ -8,7 +8,7 @@ import { SaveCredentialRequest } from "./request/save-credential.request"; import { WebauthnLoginCredentialCreateOptionsResponse } from "./response/webauthn-login-credential-create-options.response"; import { WebauthnLoginCredentialResponse } from "./response/webauthn-login-credential.response"; -@Injectable({ providedIn: "root" }) +@Injectable() export class WebauthnLoginApiService { constructor(private apiService: ApiService) {} diff --git a/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login.service.ts b/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login.service.ts index c5979f08c6..bfca1481ff 100644 --- a/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login.service.ts +++ b/apps/web/src/app/auth/core/services/webauthn-login/webauthn-login.service.ts @@ -12,7 +12,7 @@ import { SaveCredentialRequest } from "./request/save-credential.request"; import { WebauthnLoginAttestationResponseRequest } from "./request/webauthn-login-attestation-response.request"; import { WebauthnLoginApiService } from "./webauthn-login-api.service"; -@Injectable({ providedIn: "root" }) +@Injectable() export class WebauthnLoginService { static readonly MaxCredentialCount = 5; diff --git a/apps/web/src/app/auth/emergency-access/accept-emergency.component.ts b/apps/web/src/app/auth/emergency-access/accept-emergency.component.ts index 2dfa91ff6d..c993d525be 100644 --- a/apps/web/src/app/auth/emergency-access/accept-emergency.component.ts +++ b/apps/web/src/app/auth/emergency-access/accept-emergency.component.ts @@ -7,7 +7,7 @@ import { BaseAcceptComponent } from "../../common/base.accept.component"; import { StateService } from "../../core"; import { I18nService } from "../../core/i18n.service"; import { SharedModule } from "../../shared"; -import { EmergencyAccessService } from "../core/services/emergency-access/emergency-access.service"; +import { EmergencyAccessService } from "../core"; @Component({ standalone: true, diff --git a/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.spec.ts b/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.spec.ts index db3ea5fbc7..46e5700a5f 100644 --- a/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.spec.ts +++ b/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.spec.ts @@ -9,8 +9,6 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga import { OrganizationKeysResponse } from "@bitwarden/common/admin-console/models/response/organization-keys.response"; import { OrganizationApiService } from "@bitwarden/common/admin-console/services/organization/organization-api.service"; import { EncryptionType, KdfType } from "@bitwarden/common/enums"; -import { ListResponse } from "@bitwarden/common/models/response/list.response"; -import { UserKeyResponse } from "@bitwarden/common/models/response/user-key.response"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service"; import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; @@ -31,8 +29,9 @@ import { Folder } from "@bitwarden/common/vault/models/domain/folder"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; +import { EmergencyAccessService } from "../core"; + import { MigrateFromLegacyEncryptionService } from "./migrate-legacy-encryption.service"; -import { EmergencyAccessService } from "../core/services/emergency-access/emergency-access.service"; describe("migrateFromLegacyEncryptionService", () => { let migrateFromLegacyEncryptionService: MigrateFromLegacyEncryptionService; diff --git a/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.ts b/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.ts index ccb54cea5b..e305fe1c39 100644 --- a/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.ts +++ b/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.service.ts @@ -20,7 +20,8 @@ import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folde import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { CipherWithIdRequest } from "@bitwarden/common/vault/models/request/cipher-with-id.request"; import { FolderWithIdRequest } from "@bitwarden/common/vault/models/request/folder-with-id.request"; -import { EmergencyAccessService } from "../core/services/emergency-access/emergency-access.service"; + +import { EmergencyAccessService } from "../core"; // TODO: PM-3797 - This service should be expanded and used for user key rotations in change-password.component.ts @Injectable() diff --git a/apps/web/src/app/auth/settings/change-password.component.ts b/apps/web/src/app/auth/settings/change-password.component.ts index 03eeeb4f19..9fa663369a 100644 --- a/apps/web/src/app/auth/settings/change-password.component.ts +++ b/apps/web/src/app/auth/settings/change-password.component.ts @@ -33,7 +33,8 @@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.serv import { CipherWithIdRequest } from "@bitwarden/common/vault/models/request/cipher-with-id.request"; import { FolderWithIdRequest } from "@bitwarden/common/vault/models/request/folder-with-id.request"; import { DialogService } from "@bitwarden/components"; -import { EmergencyAccessService } from "../core/services/emergency-access/emergency-access.service"; + +import { EmergencyAccessService } from "../core"; @Component({ selector: "app-change-password", diff --git a/apps/web/src/app/auth/settings/emergency-access/emergency-access-add-edit.component.ts b/apps/web/src/app/auth/settings/emergency-access/emergency-access-add-edit.component.ts index 64486f7377..482bfade6c 100644 --- a/apps/web/src/app/auth/settings/emergency-access/emergency-access-add-edit.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/emergency-access-add-edit.component.ts @@ -3,8 +3,9 @@ import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; + +import { EmergencyAccessService } from "../../core"; import { EmergencyAccessType } from "../../core/enums/emergency-access-type"; -import { EmergencyAccessService } from "../../core/services/emergency-access/emergency-access.service"; @Component({ selector: "emergency-access-add-edit", diff --git a/apps/web/src/app/auth/settings/emergency-access/emergency-access-takeover.component.ts b/apps/web/src/app/auth/settings/emergency-access/emergency-access-takeover.component.ts index d27c5e1568..8906cbcbd4 100644 --- a/apps/web/src/app/auth/settings/emergency-access/emergency-access-takeover.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/emergency-access-takeover.component.ts @@ -13,7 +13,7 @@ import { StateService } from "@bitwarden/common/platform/abstractions/state.serv import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password"; import { DialogService } from "@bitwarden/components"; -import { EmergencyAccessService } from "../../core/services/emergency-access/emergency-access.service"; +import { EmergencyAccessService } from "../../core"; @Component({ selector: "emergency-access-takeover", diff --git a/apps/web/src/app/auth/settings/emergency-access/emergency-access-view.component.ts b/apps/web/src/app/auth/settings/emergency-access/emergency-access-view.component.ts index 7d63ef8b28..d7e52665f2 100644 --- a/apps/web/src/app/auth/settings/emergency-access/emergency-access-view.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/emergency-access-view.component.ts @@ -3,7 +3,8 @@ import { ActivatedRoute, Router } from "@angular/router"; import { ModalService } from "@bitwarden/angular/services/modal.service"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { EmergencyAccessService } from "../../core/services/emergency-access/emergency-access.service"; + +import { EmergencyAccessService } from "../../core"; import { EmergencyAccessAttachmentsComponent } from "./emergency-access-attachments.component"; import { EmergencyAddEditComponent } from "./emergency-add-edit.component"; diff --git a/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts b/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts index acee518a9b..c687e31dc3 100644 --- a/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts @@ -10,9 +10,9 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { DialogService } from "@bitwarden/components"; +import { EmergencyAccessService } from "../../core"; import { EmergencyAccessStatusType } from "../../core/enums/emergency-access-status-type"; import { EmergencyAccessType } from "../../core/enums/emergency-access-type"; -import { EmergencyAccessService } from "../../core/services/emergency-access/emergency-access.service"; import { EmergencyAccessGranteeView, EmergencyAccessGrantorView,