diff --git a/.github/codecov.yml b/.github/codecov.yml index 0a6b3ceacff..f375621bd87 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -46,6 +46,7 @@ component_management: - libs/key-management/src/kdf-config.service.ts - libs/key-management/src/key.service.ts - libs/common/src/key-management/master-password/** + - libs/common/src/key-management/key-connector/** - component_id: key-management-crypto name: Key Management - Crypto paths: diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index c65366c7796..48ecca540e8 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -146,9 +146,9 @@ jobs: # Note, before updating the ubuntu version of the workflow, ensure the snap base image # is equal or greater than the new version. Otherwise there might be GLIBC version issues. # The snap base for desktop is defined in `apps/desktop/electron-builder.json` - # We are currently running on 20.04 until the Ubuntu 24.04 release is available, as moving - # to 22.04 now breaks users who are on 20.04 due to mismatched GLIBC versions. - runs-on: ubuntu-20.04 + # We intentionally keep this runner on the oldest supported OS in GitHub Actions + # for maximum compatibility across GLIBC versions + runs-on: ubuntu-22.04 needs: setup env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 86977b950f3..abbe2840d6f 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -263,12 +263,6 @@ "enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou": { "message": "Enter your account email address and your password hint will be sent to you" }, - "passwordHint": { - "message": "Password hint" - }, - "enterEmailToGetHint": { - "message": "Enter your account email address to receive your master password hint." - }, "getMasterPasswordHint": { "message": "Get master password hint" }, diff --git a/apps/browser/src/auth/popup/hint.component.html b/apps/browser/src/auth/popup/hint.component.html deleted file mode 100644 index c3d5ef3d8b7..00000000000 --- a/apps/browser/src/auth/popup/hint.component.html +++ /dev/null @@ -1,41 +0,0 @@ -
-
-
- -
-

- {{ "passwordHint" | i18n }} -

-
- -
-
-
-
-
-
- - -
-
- -
-
-
diff --git a/apps/browser/src/auth/popup/hint.component.ts b/apps/browser/src/auth/popup/hint.component.ts deleted file mode 100644 index e97236fe6a8..00000000000 --- a/apps/browser/src/auth/popup/hint.component.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Component } from "@angular/core"; -import { ActivatedRoute, Router } from "@angular/router"; - -import { HintComponent as BaseHintComponent } from "@bitwarden/angular/auth/components/hint.component"; -import { LoginEmailServiceAbstraction } from "@bitwarden/auth/common"; -import { ApiService } from "@bitwarden/common/abstractions/api.service"; -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 { ToastService } from "@bitwarden/components"; - -@Component({ - selector: "app-hint", - templateUrl: "hint.component.html", -}) -export class HintComponent extends BaseHintComponent { - constructor( - router: Router, - platformUtilsService: PlatformUtilsService, - i18nService: I18nService, - apiService: ApiService, - logService: LogService, - private route: ActivatedRoute, - loginEmailService: LoginEmailServiceAbstraction, - toastService: ToastService, - ) { - super( - router, - i18nService, - apiService, - platformUtilsService, - logService, - loginEmailService, - toastService, - ); - - this.onSuccessfulSubmit = async () => { - // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.router.navigate([this.successRoute]); - }; - } -} diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index faee95a324e..2769c536049 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -35,7 +35,6 @@ import { AvatarService as AvatarServiceAbstraction } from "@bitwarden/common/aut import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction"; import { DevicesServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices/devices.service.abstraction"; import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction"; -import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction"; import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction"; import { TokenService as TokenServiceAbstraction } from "@bitwarden/common/auth/abstractions/token.service"; @@ -49,7 +48,6 @@ import { AvatarService } from "@bitwarden/common/auth/services/avatar.service"; import { DeviceTrustService } from "@bitwarden/common/auth/services/device-trust.service.implementation"; import { DevicesServiceImplementation } from "@bitwarden/common/auth/services/devices/devices.service.implementation"; import { DevicesApiServiceImplementation } from "@bitwarden/common/auth/services/devices-api.service.implementation"; -import { KeyConnectorService } from "@bitwarden/common/auth/services/key-connector.service"; import { MasterPasswordService } from "@bitwarden/common/auth/services/master-password/master-password.service"; import { SsoLoginService } from "@bitwarden/common/auth/services/sso-login.service"; import { TokenService } from "@bitwarden/common/auth/services/token.service"; @@ -82,6 +80,8 @@ import { BulkEncryptServiceImplementation } from "@bitwarden/common/key-manageme import { EncryptServiceImplementation } from "@bitwarden/common/key-management/crypto/services/encrypt.service.implementation"; import { FallbackBulkEncryptService } from "@bitwarden/common/key-management/crypto/services/fallback-bulk-encrypt.service"; import { MultithreadEncryptServiceImplementation } from "@bitwarden/common/key-management/crypto/services/multithread-encrypt.service.implementation"; +import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/services/key-connector.service"; import { DefaultProcessReloadService } from "@bitwarden/common/key-management/services/default-process-reload.service"; import { DefaultVaultTimeoutSettingsService, diff --git a/apps/browser/src/popup/app.module.ts b/apps/browser/src/popup/app.module.ts index 72117a2f900..248f10214f1 100644 --- a/apps/browser/src/popup/app.module.ts +++ b/apps/browser/src/popup/app.module.ts @@ -21,7 +21,6 @@ import { AccountComponent } from "../auth/popup/account-switching/account.compon import { CurrentAccountComponent } from "../auth/popup/account-switching/current-account.component"; import { EnvironmentComponent } from "../auth/popup/environment.component"; import { ExtensionAnonLayoutWrapperComponent } from "../auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component"; -import { HintComponent } from "../auth/popup/hint.component"; import { LoginDecryptionOptionsComponentV1 } from "../auth/popup/login-decryption-options/login-decryption-options-v1.component"; import { RemovePasswordComponent } from "../auth/popup/remove-password.component"; import { SetPasswordComponent } from "../auth/popup/set-password.component"; @@ -94,7 +93,6 @@ import "../platform/popup/locales"; ColorPasswordPipe, ColorPasswordCountPipe, EnvironmentComponent, - HintComponent, LoginDecryptionOptionsComponentV1, SetPasswordComponent, SsoComponentV1, diff --git a/apps/cli/src/auth/commands/login.command.ts b/apps/cli/src/auth/commands/login.command.ts index 8fae8302bc9..9af6e1f0613 100644 --- a/apps/cli/src/auth/commands/login.command.ts +++ b/apps/cli/src/auth/commands/login.command.ts @@ -20,7 +20,6 @@ import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abs import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { MasterPasswordApiService } from "@bitwarden/common/auth/abstractions/master-password-api.service.abstraction"; import { TwoFactorService } from "@bitwarden/common/auth/abstractions/two-factor.service"; import { TwoFactorProviderType } from "@bitwarden/common/auth/enums/two-factor-provider-type"; @@ -31,6 +30,7 @@ import { PasswordRequest } from "@bitwarden/common/auth/models/request/password. import { TwoFactorEmailRequest } from "@bitwarden/common/auth/models/request/two-factor-email.request"; import { UpdateTempPasswordRequest } from "@bitwarden/common/auth/models/request/update-temp-password.request"; import { ClientType } from "@bitwarden/common/enums"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { ErrorResponse } from "@bitwarden/common/models/response/error.response"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service"; diff --git a/apps/cli/src/auth/commands/unlock.command.ts b/apps/cli/src/auth/commands/unlock.command.ts index 2b55efba2cb..6cc52b3903c 100644 --- a/apps/cli/src/auth/commands/unlock.command.ts +++ b/apps/cli/src/auth/commands/unlock.command.ts @@ -4,11 +4,11 @@ import { firstValueFrom, map } from "rxjs"; import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction"; import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; import { VerificationType } from "@bitwarden/common/auth/enums/verification-type"; import { MasterPasswordVerification } from "@bitwarden/common/auth/types/verification"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; diff --git a/apps/cli/src/commands/convert-to-key-connector.command.ts b/apps/cli/src/commands/convert-to-key-connector.command.ts index a87483af625..2f1f47a087c 100644 --- a/apps/cli/src/commands/convert-to-key-connector.command.ts +++ b/apps/cli/src/commands/convert-to-key-connector.command.ts @@ -2,7 +2,7 @@ import * as inquirer from "inquirer"; import { firstValueFrom } from "rxjs"; import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { EnvironmentService, Region, diff --git a/apps/cli/src/service-container/service-container.ts b/apps/cli/src/service-container/service-container.ts index 93d269ce095..11031590b5f 100644 --- a/apps/cli/src/service-container/service-container.ts +++ b/apps/cli/src/service-container/service-container.ts @@ -46,7 +46,6 @@ import { AuthService } from "@bitwarden/common/auth/services/auth.service"; import { AvatarService } from "@bitwarden/common/auth/services/avatar.service"; import { DeviceTrustService } from "@bitwarden/common/auth/services/device-trust.service.implementation"; import { DevicesApiServiceImplementation } from "@bitwarden/common/auth/services/devices-api.service.implementation"; -import { KeyConnectorService } from "@bitwarden/common/auth/services/key-connector.service"; import { MasterPasswordApiService } from "@bitwarden/common/auth/services/master-password/master-password-api.service.implementation"; import { MasterPasswordService } from "@bitwarden/common/auth/services/master-password/master-password.service"; import { TokenService } from "@bitwarden/common/auth/services/token.service"; @@ -66,6 +65,7 @@ import { DefaultBillingAccountProfileStateService } from "@bitwarden/common/bill import { ClientType } from "@bitwarden/common/enums"; import { EncryptServiceImplementation } from "@bitwarden/common/key-management/crypto/services/encrypt.service.implementation"; import { FallbackBulkEncryptService } from "@bitwarden/common/key-management/crypto/services/fallback-bulk-encrypt.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/services/key-connector.service"; import { DefaultVaultTimeoutService, DefaultVaultTimeoutSettingsService, diff --git a/apps/desktop/electron-builder.json b/apps/desktop/electron-builder.json index 2922035a913..30d87c5c662 100644 --- a/apps/desktop/electron-builder.json +++ b/apps/desktop/electron-builder.json @@ -249,7 +249,8 @@ "polkit": { "action-prefix": "com.bitwarden.Bitwarden" } - } + }, + "u2f-devices" ], "stagePackages": ["default"] }, diff --git a/apps/desktop/resources/com.bitwarden.desktop.devel.yaml b/apps/desktop/resources/com.bitwarden.desktop.devel.yaml index fea28052f8d..3aeebfd809d 100644 --- a/apps/desktop/resources/com.bitwarden.desktop.devel.yaml +++ b/apps/desktop/resources/com.bitwarden.desktop.devel.yaml @@ -22,6 +22,7 @@ finish-args: - --talk-name=org.freedesktop.ScreenSaver - --system-talk-name=org.freedesktop.login1 - --filesystem=xdg-download + - --device=all modules: - name: bitwarden-desktop buildsystem: simple diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index 1ef03e5bb71..8828b820cd5 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -26,7 +26,6 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction import { InternalPolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { MasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction"; import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; @@ -34,6 +33,7 @@ import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/for import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ProcessReloadServiceAbstraction } from "@bitwarden/common/key-management/abstractions/process-reload.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { VaultTimeout, VaultTimeoutAction, diff --git a/apps/desktop/src/app/app.module.ts b/apps/desktop/src/app/app.module.ts index dc57fd53c07..dbb4ddeb031 100644 --- a/apps/desktop/src/app/app.module.ts +++ b/apps/desktop/src/app/app.module.ts @@ -13,7 +13,6 @@ import { DecryptionFailureDialogComponent } from "@bitwarden/vault"; import { AccessibilityCookieComponent } from "../auth/accessibility-cookie.component"; import { DeleteAccountComponent } from "../auth/delete-account.component"; import { EnvironmentComponent } from "../auth/environment.component"; -import { HintComponent } from "../auth/hint.component"; import { LoginModule } from "../auth/login/login.module"; import { RemovePasswordComponent } from "../auth/remove-password.component"; import { SetPasswordComponent } from "../auth/set-password.component"; @@ -74,7 +73,6 @@ import { SharedModule } from "./shared/shared.module"; EnvironmentComponent, FolderAddEditComponent, HeaderComponent, - HintComponent, PasswordHistoryComponent, PremiumComponent, RemovePasswordComponent, diff --git a/apps/desktop/src/auth/hint.component.html b/apps/desktop/src/auth/hint.component.html deleted file mode 100644 index a46479efee0..00000000000 --- a/apps/desktop/src/auth/hint.component.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
-

{{ "passwordHint" | i18n }}

-
-
-
- - -
-
- -
-
- - -
-
-
diff --git a/apps/desktop/src/auth/hint.component.ts b/apps/desktop/src/auth/hint.component.ts deleted file mode 100644 index 34457029257..00000000000 --- a/apps/desktop/src/auth/hint.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Component } from "@angular/core"; -import { Router } from "@angular/router"; - -import { HintComponent as BaseHintComponent } from "@bitwarden/angular/auth/components/hint.component"; -import { LoginEmailServiceAbstraction } from "@bitwarden/auth/common"; -import { ApiService } from "@bitwarden/common/abstractions/api.service"; -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 { ToastService } from "@bitwarden/components"; - -@Component({ - selector: "app-hint", - templateUrl: "hint.component.html", -}) -export class HintComponent extends BaseHintComponent { - constructor( - router: Router, - platformUtilsService: PlatformUtilsService, - i18nService: I18nService, - apiService: ApiService, - logService: LogService, - loginEmailService: LoginEmailServiceAbstraction, - toastService: ToastService, - ) { - super( - router, - i18nService, - apiService, - platformUtilsService, - logService, - loginEmailService, - toastService, - ); - } -} diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json index 0bc76287adb..92fe91d962c 100644 --- a/apps/desktop/src/locales/en/messages.json +++ b/apps/desktop/src/locales/en/messages.json @@ -748,12 +748,6 @@ "enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou": { "message": "Enter your account email address and your password hint will be sent to you" }, - "passwordHint": { - "message": "Password hint" - }, - "enterEmailToGetHint": { - "message": "Enter your account email address to receive your master password hint." - }, "getMasterPasswordHint": { "message": "Get master password hint" }, diff --git a/apps/desktop/src/platform/services/electron-platform-utils.service.ts b/apps/desktop/src/platform/services/electron-platform-utils.service.ts index e86d44f71f2..b7c82f4e5db 100644 --- a/apps/desktop/src/platform/services/electron-platform-utils.service.ts +++ b/apps/desktop/src/platform/services/electron-platform-utils.service.ts @@ -77,11 +77,9 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService { return (await this.getApplicationVersion()).split(/[+|-]/)[0].trim(); } - // Restricted to Windows and Mac. Mac is missing support for pin entry, and Linux is missing support entirely and has to be implemented in another way. + // Linux and Mac are missing a ui to enter a pin, so this works for two-factor security keys, when always-uv is not active supportsWebAuthn(win: Window): boolean { - return ( - this.getDevice() === DeviceType.WindowsDesktop || this.getDevice() === DeviceType.MacOsDesktop - ); + return true; } supportsDuo(): boolean { diff --git a/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html b/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html index 3151c303ec9..9fb8b245f72 100644 --- a/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html +++ b/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html @@ -9,7 +9,7 @@
diff --git a/apps/web/src/app/admin-console/organizations/manage/groups.component.html b/apps/web/src/app/admin-console/organizations/manage/groups.component.html index 1254d48cc76..82ad2c36b8c 100644 --- a/apps/web/src/app/admin-console/organizations/manage/groups.component.html +++ b/apps/web/src/app/admin-console/organizations/manage/groups.component.html @@ -12,7 +12,7 @@ diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-status.component.html b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-status.component.html index 684c7971c1b..0b238c17d2f 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-status.component.html +++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-status.component.html @@ -18,7 +18,9 @@ {{ item.user.email }} - {{ item.user.name }} + {{ + item.user.name + }} {{ item.message }} diff --git a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html index 44c9d8319cb..db7422bd34b 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html +++ b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html @@ -12,7 +12,7 @@
diff --git a/apps/web/src/app/admin-console/organizations/members/members.component.html b/apps/web/src/app/admin-console/organizations/members/members.component.html index 52315d30177..f2995e31f12 100644 --- a/apps/web/src/app/admin-console/organizations/members/members.component.html +++ b/apps/web/src/app/admin-console/organizations/members/members.component.html @@ -48,7 +48,7 @@
diff --git a/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.html b/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.html index 7640e1c7366..fdbb6dbba91 100644 --- a/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.html +++ b/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.html @@ -1,13 +1,13 @@ -
+
- -

+ +

{{ "loading" | i18n }} -

+
diff --git a/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts b/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts index bef0589df83..7ceaed28f80 100644 --- a/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts +++ b/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts @@ -3,6 +3,7 @@ import { Component, inject } from "@angular/core"; import { Params } from "@angular/router"; +import { BitwardenLogo } from "@bitwarden/auth/angular"; import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction"; import { OrganizationSponsorshipResponse } from "@bitwarden/common/admin-console/models/response/organization-sponsorship.response"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; @@ -20,6 +21,7 @@ import { BaseAcceptComponent } from "../../../common/base.accept.component"; templateUrl: "accept-family-sponsorship.component.html", }) export class AcceptFamilySponsorshipComponent extends BaseAcceptComponent { + protected logo = BitwardenLogo; failedShortMessage = "inviteAcceptFailedShort"; failedMessage = "inviteAcceptFailed"; diff --git a/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.html b/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.html index b9956ebed1c..64a4eb3067d 100644 --- a/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.html +++ b/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.html @@ -29,7 +29,7 @@
-
+
diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index f6e038f85d9..55e2595e0f7 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -16,10 +16,10 @@ import { InternalOrganizationServiceAbstraction } from "@bitwarden/common/admin- import { InternalPolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { ProcessReloadServiceAbstraction } from "@bitwarden/common/key-management/abstractions/process-reload.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { VaultTimeoutService } from "@bitwarden/common/key-management/vault-timeout"; import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service"; import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service"; diff --git a/apps/web/src/app/auth/hint.component.html b/apps/web/src/app/auth/hint.component.html deleted file mode 100644 index 9f4d76d8405..00000000000 --- a/apps/web/src/app/auth/hint.component.html +++ /dev/null @@ -1,23 +0,0 @@ -
- - {{ "emailAddress" | i18n }} - - {{ "enterEmailToGetHint" | i18n }} - -
-
- - - {{ "cancel" | i18n }} - -
-
diff --git a/apps/web/src/app/auth/hint.component.ts b/apps/web/src/app/auth/hint.component.ts deleted file mode 100644 index 5c180063084..00000000000 --- a/apps/web/src/app/auth/hint.component.ts +++ /dev/null @@ -1,64 +0,0 @@ -// FIXME: Update this file to be type safe and remove this and next line -// @ts-strict-ignore -import { Component, OnInit } from "@angular/core"; -import { FormBuilder, Validators } from "@angular/forms"; -import { Router } from "@angular/router"; - -import { HintComponent as BaseHintComponent } from "@bitwarden/angular/auth/components/hint.component"; -import { LoginEmailServiceAbstraction } from "@bitwarden/auth/common"; -import { ApiService } from "@bitwarden/common/abstractions/api.service"; -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 { ToastService } from "@bitwarden/components"; - -@Component({ - selector: "app-hint", - templateUrl: "hint.component.html", -}) -export class HintComponent extends BaseHintComponent implements OnInit { - formGroup = this.formBuilder.group({ - email: ["", [Validators.email, Validators.required]], - }); - - get emailFormControl() { - return this.formGroup.controls.email; - } - - constructor( - router: Router, - i18nService: I18nService, - apiService: ApiService, - platformUtilsService: PlatformUtilsService, - logService: LogService, - loginEmailService: LoginEmailServiceAbstraction, - private formBuilder: FormBuilder, - protected toastService: ToastService, - ) { - super( - router, - i18nService, - apiService, - platformUtilsService, - logService, - loginEmailService, - toastService, - ); - } - - async ngOnInit(): Promise { - await super.ngOnInit(); - this.emailFormControl.setValue(this.email); - } - - // Wrapper method to call super.submit() since properties (e.g., submit) cannot use super directly - // This is because properties are assigned per type and generally don't have access to the prototype - async superSubmit() { - await super.submit(); - } - - submit = async () => { - this.email = this.emailFormControl.value; - await this.superSubmit(); - }; -} diff --git a/apps/web/src/app/shared/loose-components.module.ts b/apps/web/src/app/shared/loose-components.module.ts index d57cc6bc1b4..f21a9338491 100644 --- a/apps/web/src/app/shared/loose-components.module.ts +++ b/apps/web/src/app/shared/loose-components.module.ts @@ -12,7 +12,6 @@ import { EventsComponent as OrgEventsComponent } from "../admin-console/organiza import { UserConfirmComponent as OrgUserConfirmComponent } from "../admin-console/organizations/manage/user-confirm.component"; import { VerifyRecoverDeleteOrgComponent } from "../admin-console/organizations/manage/verify-recover-delete-org.component"; import { AcceptFamilySponsorshipComponent } from "../admin-console/organizations/sponsorships/accept-family-sponsorship.component"; -import { HintComponent } from "../auth/hint.component"; import { RecoverDeleteComponent } from "../auth/recover-delete.component"; import { RecoverTwoFactorComponent } from "../auth/recover-two-factor.component"; import { RemovePasswordComponent } from "../auth/remove-password.component"; @@ -126,7 +125,6 @@ import { SharedModule } from "./shared.module"; EmergencyAccessViewComponent, FolderAddEditComponent, FrontendLayoutComponent, - HintComponent, OrgAddEditComponent, OrgAttachmentsComponent, OrgEventsComponent, @@ -188,7 +186,6 @@ import { SharedModule } from "./shared.module"; EmergencyAccessViewComponent, FolderAddEditComponent, FrontendLayoutComponent, - HintComponent, OrgAddEditComponent, OrganizationLayoutComponent, OrgAttachmentsComponent, diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 3e47e2b2279..0643861db1b 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -1307,12 +1307,6 @@ "enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou": { "message": "Enter your account email address and your password hint will be sent to you" }, - "passwordHint": { - "message": "Password hint" - }, - "enterEmailToGetHint": { - "message": "Enter your account email address to receive your master password hint." - }, "getMasterPasswordHint": { "message": "Get master password hint" }, diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/accept-provider.component.html b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/accept-provider.component.html index 37d5001f776..30cd7fec8f2 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/accept-provider.component.html +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/accept-provider.component.html @@ -1,6 +1,6 @@
- +

{{ "deleteProvider" | i18n }}

+

{{ "deleteProvider" | i18n }}

{{ "deleteProviderWarning" | i18n }}

{{ name }} diff --git a/libs/angular/src/auth/components/hint.component.ts b/libs/angular/src/auth/components/hint.component.ts deleted file mode 100644 index 09648314a9c..00000000000 --- a/libs/angular/src/auth/components/hint.component.ts +++ /dev/null @@ -1,74 +0,0 @@ -// FIXME: Update this file to be type safe and remove this and next line -// @ts-strict-ignore -import { Directive, OnInit } from "@angular/core"; -import { Router } from "@angular/router"; -import { firstValueFrom } from "rxjs"; - -import { LoginEmailServiceAbstraction } from "@bitwarden/auth/common"; -import { ApiService } from "@bitwarden/common/abstractions/api.service"; -import { PasswordHintRequest } from "@bitwarden/common/auth/models/request/password-hint.request"; -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 { ToastService } from "@bitwarden/components"; - -@Directive() -export class HintComponent implements OnInit { - email = ""; - formPromise: Promise; - - protected successRoute = "login"; - protected onSuccessfulSubmit: () => void; - - constructor( - protected router: Router, - protected i18nService: I18nService, - protected apiService: ApiService, - protected platformUtilsService: PlatformUtilsService, - private logService: LogService, - private loginEmailService: LoginEmailServiceAbstraction, - protected toastService: ToastService, - ) {} - - async ngOnInit(): Promise { - this.email = (await firstValueFrom(this.loginEmailService.loginEmail$)) ?? ""; - } - - async submit() { - if (this.email == null || this.email === "") { - this.toastService.showToast({ - variant: "error", - title: this.i18nService.t("errorOccurred"), - message: this.i18nService.t("emailRequired"), - }); - return; - } - if (this.email.indexOf("@") === -1) { - this.toastService.showToast({ - variant: "error", - title: this.i18nService.t("errorOccurred"), - message: this.i18nService.t("invalidEmail"), - }); - return; - } - - try { - this.formPromise = this.apiService.postPasswordHint(new PasswordHintRequest(this.email)); - await this.formPromise; - this.toastService.showToast({ - variant: "success", - title: null, - message: this.i18nService.t("masterPassSent"), - }); - if (this.onSuccessfulSubmit != null) { - this.onSuccessfulSubmit(); - } else if (this.router != null) { - // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.router.navigate([this.successRoute]); - } - } catch (e) { - this.logService.error(e); - } - } -} diff --git a/libs/angular/src/auth/components/remove-password.component.ts b/libs/angular/src/auth/components/remove-password.component.ts index baf986d3211..2ecf49701b5 100644 --- a/libs/angular/src/auth/components/remove-password.component.ts +++ b/libs/angular/src/auth/components/remove-password.component.ts @@ -5,7 +5,7 @@ import { firstValueFrom } from "rxjs"; import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { ErrorResponse } from "@bitwarden/common/models/response/error.response"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; diff --git a/libs/angular/src/auth/guards/auth.guard.spec.ts b/libs/angular/src/auth/guards/auth.guard.spec.ts index a6bfd72e23e..0e3519b94eb 100644 --- a/libs/angular/src/auth/guards/auth.guard.spec.ts +++ b/libs/angular/src/auth/guards/auth.guard.spec.ts @@ -11,10 +11,10 @@ import { AccountService, } from "@bitwarden/common/auth/abstractions/account.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { MasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { UserId } from "@bitwarden/common/types/guid"; diff --git a/libs/angular/src/auth/guards/auth.guard.ts b/libs/angular/src/auth/guards/auth.guard.ts index 8d20d7323da..4d98e9d663c 100644 --- a/libs/angular/src/auth/guards/auth.guard.ts +++ b/libs/angular/src/auth/guards/auth.guard.ts @@ -12,10 +12,10 @@ import { firstValueFrom } from "rxjs"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { MasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; export const authGuard: CanActivateFn = async ( diff --git a/libs/angular/src/services/jslib-services.module.ts b/libs/angular/src/services/jslib-services.module.ts index cebd567ce58..1d832ce67af 100644 --- a/libs/angular/src/services/jslib-services.module.ts +++ b/libs/angular/src/services/jslib-services.module.ts @@ -90,7 +90,6 @@ import { AvatarService as AvatarServiceAbstraction } from "@bitwarden/common/aut import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction"; import { DevicesServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices/devices.service.abstraction"; import { DevicesApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices-api.service.abstraction"; -import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { MasterPasswordApiService as MasterPasswordApiServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password-api.service.abstraction"; import { InternalMasterPasswordServiceAbstraction, @@ -113,7 +112,6 @@ import { AvatarService } from "@bitwarden/common/auth/services/avatar.service"; import { DeviceTrustService } from "@bitwarden/common/auth/services/device-trust.service.implementation"; import { DevicesServiceImplementation } from "@bitwarden/common/auth/services/devices/devices.service.implementation"; import { DevicesApiServiceImplementation } from "@bitwarden/common/auth/services/devices-api.service.implementation"; -import { KeyConnectorService } from "@bitwarden/common/auth/services/key-connector.service"; import { MasterPasswordApiService } from "@bitwarden/common/auth/services/master-password/master-password-api.service.implementation"; import { MasterPasswordService } from "@bitwarden/common/auth/services/master-password/master-password.service"; import { PasswordResetEnrollmentServiceImplementation } from "@bitwarden/common/auth/services/password-reset-enrollment.service.implementation"; @@ -155,6 +153,8 @@ import { BulkEncryptService } from "@bitwarden/common/key-management/crypto/abst import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service"; import { BulkEncryptServiceImplementation } from "@bitwarden/common/key-management/crypto/services/bulk-encrypt.service.implementation"; import { MultithreadEncryptServiceImplementation } from "@bitwarden/common/key-management/crypto/services/multithread-encrypt.service.implementation"; +import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/services/key-connector.service"; import { DefaultVaultTimeoutService, DefaultVaultTimeoutSettingsService, diff --git a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts index c5e174484b0..164102bc3b0 100644 --- a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts +++ b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts @@ -188,8 +188,7 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy { this.twoFactorAuthComponentService.shouldCheckForWebAuthnQueryParamResponse() && webAuthnSupported ) { - const webAuthn2faResponse = - this.activatedRoute.snapshot.queryParamMap.get("webAuthnResponse"); + const webAuthn2faResponse = this.activatedRoute.snapshot.paramMap.get("webAuthnResponse"); if (webAuthn2faResponse) { this.selectedProviderType = TwoFactorProviderType.WebAuthn; return; diff --git a/libs/auth/src/common/login-strategies/sso-login.strategy.spec.ts b/libs/auth/src/common/login-strategies/sso-login.strategy.spec.ts index 6efb17a8d26..8cb2dd553c1 100644 --- a/libs/auth/src/common/login-strategies/sso-login.strategy.spec.ts +++ b/libs/auth/src/common/login-strategies/sso-login.strategy.spec.ts @@ -3,7 +3,6 @@ import { BehaviorSubject } from "rxjs"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { TokenService } from "@bitwarden/common/auth/abstractions/token.service"; import { TwoFactorService } from "@bitwarden/common/auth/abstractions/two-factor.service"; import { AdminAuthRequestStorable } from "@bitwarden/common/auth/models/domain/admin-auth-req-storable"; @@ -13,6 +12,7 @@ import { IUserDecryptionOptionsServerResponse } from "@bitwarden/common/auth/mod import { FakeMasterPasswordService } from "@bitwarden/common/auth/services/master-password/fake-master-password.service"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service"; import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { VaultTimeoutAction, VaultTimeoutSettingsService, diff --git a/libs/auth/src/common/login-strategies/sso-login.strategy.ts b/libs/auth/src/common/login-strategies/sso-login.strategy.ts index f4eaa10c319..91d9dd43be2 100644 --- a/libs/auth/src/common/login-strategies/sso-login.strategy.ts +++ b/libs/auth/src/common/login-strategies/sso-login.strategy.ts @@ -4,12 +4,12 @@ import { firstValueFrom, Observable, map, BehaviorSubject } from "rxjs"; import { Jsonify } from "type-fest"; import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result"; import { SsoTokenRequest } from "@bitwarden/common/auth/models/request/identity-token/sso-token.request"; import { AuthRequestResponse } from "@bitwarden/common/auth/models/response/auth-request.response"; import { IdentityTokenResponse } from "@bitwarden/common/auth/models/response/identity-token.response"; import { HttpStatusCode } from "@bitwarden/common/enums"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { ErrorResponse } from "@bitwarden/common/models/response/error.response"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { UserId } from "@bitwarden/common/types/guid"; diff --git a/libs/auth/src/common/login-strategies/user-api-login.strategy.spec.ts b/libs/auth/src/common/login-strategies/user-api-login.strategy.spec.ts index c0c7e828b68..2ce3795c39b 100644 --- a/libs/auth/src/common/login-strategies/user-api-login.strategy.spec.ts +++ b/libs/auth/src/common/login-strategies/user-api-login.strategy.spec.ts @@ -2,12 +2,12 @@ import { mock, MockProxy } from "jest-mock-extended"; import { BehaviorSubject } from "rxjs"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { TokenService } from "@bitwarden/common/auth/abstractions/token.service"; import { TwoFactorService } from "@bitwarden/common/auth/abstractions/two-factor.service"; import { FakeMasterPasswordService } from "@bitwarden/common/auth/services/master-password/fake-master-password.service"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service"; import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { VaultTimeoutAction, VaultTimeoutSettingsService, diff --git a/libs/auth/src/common/login-strategies/user-api-login.strategy.ts b/libs/auth/src/common/login-strategies/user-api-login.strategy.ts index 0bff20b4a65..32cd5ceaf40 100644 --- a/libs/auth/src/common/login-strategies/user-api-login.strategy.ts +++ b/libs/auth/src/common/login-strategies/user-api-login.strategy.ts @@ -3,9 +3,9 @@ import { firstValueFrom, BehaviorSubject } from "rxjs"; import { Jsonify } from "type-fest"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { UserApiTokenRequest } from "@bitwarden/common/auth/models/request/identity-token/user-api-token.request"; import { IdentityTokenResponse } from "@bitwarden/common/auth/models/response/identity-token.response"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { VaultTimeoutAction } from "@bitwarden/common/key-management/vault-timeout"; import { UserId } from "@bitwarden/common/types/guid"; diff --git a/libs/auth/src/common/services/login-strategies/login-strategy.service.spec.ts b/libs/auth/src/common/services/login-strategies/login-strategy.service.spec.ts index d8d16fa3701..4cc9ef2261c 100644 --- a/libs/auth/src/common/services/login-strategies/login-strategy.service.spec.ts +++ b/libs/auth/src/common/services/login-strategies/login-strategy.service.spec.ts @@ -4,7 +4,6 @@ import { BehaviorSubject } from "rxjs"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { TokenService } from "@bitwarden/common/auth/abstractions/token.service"; import { TwoFactorService } from "@bitwarden/common/auth/abstractions/two-factor.service"; import { TwoFactorProviderType } from "@bitwarden/common/auth/enums/two-factor-provider-type"; @@ -16,6 +15,7 @@ import { PreloginResponse } from "@bitwarden/common/auth/models/response/prelogi import { FakeMasterPasswordService } from "@bitwarden/common/auth/services/master-password/fake-master-password.service"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service"; import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { VaultTimeoutAction, VaultTimeoutSettingsService, diff --git a/libs/auth/src/common/services/login-strategies/login-strategy.service.ts b/libs/auth/src/common/services/login-strategies/login-strategy.service.ts index 4068c09338b..210d18b56e9 100644 --- a/libs/auth/src/common/services/login-strategies/login-strategy.service.ts +++ b/libs/auth/src/common/services/login-strategies/login-strategy.service.ts @@ -13,7 +13,6 @@ import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction"; import { TokenService } from "@bitwarden/common/auth/abstractions/token.service"; import { TwoFactorService } from "@bitwarden/common/auth/abstractions/two-factor.service"; @@ -22,6 +21,7 @@ import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result"; import { TokenTwoFactorRequest } from "@bitwarden/common/auth/models/request/identity-token/token-two-factor.request"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service"; import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service"; +import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { VaultTimeoutSettingsService } from "@bitwarden/common/key-management/vault-timeout"; import { PreloginRequest } from "@bitwarden/common/models/request/prelogin.request"; import { ErrorResponse } from "@bitwarden/common/models/response/error.response"; diff --git a/libs/common/src/abstractions/api.service.ts b/libs/common/src/abstractions/api.service.ts index 013b36f6358..cfef1faa7ba 100644 --- a/libs/common/src/abstractions/api.service.ts +++ b/libs/common/src/abstractions/api.service.ts @@ -46,11 +46,9 @@ import { PasswordTokenRequest } from "../auth/models/request/identity-token/pass import { SsoTokenRequest } from "../auth/models/request/identity-token/sso-token.request"; import { UserApiTokenRequest } from "../auth/models/request/identity-token/user-api-token.request"; import { WebAuthnLoginTokenRequest } from "../auth/models/request/identity-token/webauthn-login-token.request"; -import { KeyConnectorUserKeyRequest } from "../auth/models/request/key-connector-user-key.request"; import { PasswordHintRequest } from "../auth/models/request/password-hint.request"; import { PasswordlessAuthRequest } from "../auth/models/request/passwordless-auth.request"; import { SecretVerificationRequest } from "../auth/models/request/secret-verification.request"; -import { SetKeyConnectorKeyRequest } from "../auth/models/request/set-key-connector-key.request"; import { TwoFactorEmailRequest } from "../auth/models/request/two-factor-email.request"; import { TwoFactorProviderRequest } from "../auth/models/request/two-factor-provider.request"; import { TwoFactorRecoveryRequest } from "../auth/models/request/two-factor-recovery.request"; @@ -91,6 +89,8 @@ import { PaymentResponse } from "../billing/models/response/payment.response"; import { PlanResponse } from "../billing/models/response/plan.response"; import { SubscriptionResponse } from "../billing/models/response/subscription.response"; import { TaxInfoResponse } from "../billing/models/response/tax-info.response"; +import { KeyConnectorUserKeyRequest } from "../key-management/key-connector/models/key-connector-user-key.request"; +import { SetKeyConnectorKeyRequest } from "../key-management/key-connector/models/set-key-connector-key.request"; import { DeleteRecoverRequest } from "../models/request/delete-recover.request"; import { EventRequest } from "../models/request/event.request"; import { KdfRequest } from "../models/request/kdf.request"; diff --git a/libs/common/src/auth/abstractions/key-connector.service.ts b/libs/common/src/key-management/key-connector/abstractions/key-connector.service.ts similarity index 79% rename from libs/common/src/auth/abstractions/key-connector.service.ts rename to libs/common/src/key-management/key-connector/abstractions/key-connector.service.ts index 3ce79dd10d4..17b2b4d91c9 100644 --- a/libs/common/src/auth/abstractions/key-connector.service.ts +++ b/libs/common/src/key-management/key-connector/abstractions/key-connector.service.ts @@ -1,6 +1,6 @@ -import { Organization } from "../../admin-console/models/domain/organization"; -import { UserId } from "../../types/guid"; -import { IdentityTokenResponse } from "../models/response/identity-token.response"; +import { Organization } from "../../../admin-console/models/domain/organization"; +import { IdentityTokenResponse } from "../../../auth/models/response/identity-token.response"; +import { UserId } from "../../../types/guid"; export abstract class KeyConnectorService { abstract setMasterKeyFromUrl(url: string, userId: UserId): Promise; diff --git a/libs/common/src/auth/models/request/key-connector-user-key.request.ts b/libs/common/src/key-management/key-connector/models/key-connector-user-key.request.ts similarity index 100% rename from libs/common/src/auth/models/request/key-connector-user-key.request.ts rename to libs/common/src/key-management/key-connector/models/key-connector-user-key.request.ts diff --git a/libs/common/src/auth/models/request/set-key-connector-key.request.ts b/libs/common/src/key-management/key-connector/models/set-key-connector-key.request.ts similarity index 100% rename from libs/common/src/auth/models/request/set-key-connector-key.request.ts rename to libs/common/src/key-management/key-connector/models/set-key-connector-key.request.ts diff --git a/libs/common/src/auth/services/key-connector.service.spec.ts b/libs/common/src/key-management/key-connector/services/key-connector.service.spec.ts similarity index 91% rename from libs/common/src/auth/services/key-connector.service.spec.ts rename to libs/common/src/key-management/key-connector/services/key-connector.service.spec.ts index 3ed4df1dd85..f6d6992eaec 100644 --- a/libs/common/src/auth/services/key-connector.service.spec.ts +++ b/libs/common/src/key-management/key-connector/services/key-connector.service.spec.ts @@ -4,27 +4,27 @@ import { of } from "rxjs"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { KeyService } from "@bitwarden/key-management"; -import { FakeAccountService, FakeStateProvider, mockAccountServiceWith } from "../../../spec"; -import { ApiService } from "../../abstractions/api.service"; -import { OrganizationData } from "../../admin-console/models/data/organization.data"; -import { Organization } from "../../admin-console/models/domain/organization"; -import { ProfileOrganizationResponse } from "../../admin-console/models/response/profile-organization.response"; -import { LogService } from "../../platform/abstractions/log.service"; -import { Utils } from "../../platform/misc/utils"; -import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key"; -import { KeyGenerationService } from "../../platform/services/key-generation.service"; -import { OrganizationId, UserId } from "../../types/guid"; -import { MasterKey } from "../../types/key"; -import { KeyConnectorUserKeyRequest } from "../models/request/key-connector-user-key.request"; -import { KeyConnectorUserKeyResponse } from "../models/response/key-connector-user-key.response"; +import { FakeAccountService, FakeStateProvider, mockAccountServiceWith } from "../../../../spec"; +import { ApiService } from "../../../abstractions/api.service"; +import { OrganizationData } from "../../../admin-console/models/data/organization.data"; +import { Organization } from "../../../admin-console/models/domain/organization"; +import { ProfileOrganizationResponse } from "../../../admin-console/models/response/profile-organization.response"; +import { KeyConnectorUserKeyResponse } from "../../../auth/models/response/key-connector-user-key.response"; +import { FakeMasterPasswordService } from "../../../auth/services/master-password/fake-master-password.service"; +import { TokenService } from "../../../auth/services/token.service"; +import { LogService } from "../../../platform/abstractions/log.service"; +import { Utils } from "../../../platform/misc/utils"; +import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key"; +import { KeyGenerationService } from "../../../platform/services/key-generation.service"; +import { OrganizationId, UserId } from "../../../types/guid"; +import { MasterKey } from "../../../types/key"; +import { KeyConnectorUserKeyRequest } from "../models/key-connector-user-key.request"; import { USES_KEY_CONNECTOR, CONVERT_ACCOUNT_TO_KEY_CONNECTOR, KeyConnectorService, } from "./key-connector.service"; -import { FakeMasterPasswordService } from "./master-password/fake-master-password.service"; -import { TokenService } from "./token.service"; describe("KeyConnectorService", () => { let keyConnectorService: KeyConnectorService; diff --git a/libs/common/src/auth/services/key-connector.service.ts b/libs/common/src/key-management/key-connector/services/key-connector.service.ts similarity index 83% rename from libs/common/src/auth/services/key-connector.service.ts rename to libs/common/src/key-management/key-connector/services/key-connector.service.ts index 3a3419dbae1..8cea844ef7a 100644 --- a/libs/common/src/auth/services/key-connector.service.ts +++ b/libs/common/src/key-management/key-connector/services/key-connector.service.ts @@ -3,7 +3,6 @@ import { firstValueFrom } from "rxjs"; import { LogoutReason } from "@bitwarden/auth/common"; -import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Argon2KdfConfig, KdfConfig, @@ -12,28 +11,29 @@ import { KdfType, } from "@bitwarden/key-management"; -import { ApiService } from "../../abstractions/api.service"; -import { OrganizationUserType } from "../../admin-console/enums"; -import { Organization } from "../../admin-console/models/domain/organization"; -import { KeysRequest } from "../../models/request/keys.request"; -import { KeyGenerationService } from "../../platform/abstractions/key-generation.service"; -import { LogService } from "../../platform/abstractions/log.service"; -import { Utils } from "../../platform/misc/utils"; -import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key"; +import { ApiService } from "../../../abstractions/api.service"; +import { OrganizationService } from "../../../admin-console/abstractions/organization/organization.service.abstraction"; +import { OrganizationUserType } from "../../../admin-console/enums"; +import { Organization } from "../../../admin-console/models/domain/organization"; +import { InternalMasterPasswordServiceAbstraction } from "../../../auth/abstractions/master-password.service.abstraction"; +import { TokenService } from "../../../auth/abstractions/token.service"; +import { IdentityTokenResponse } from "../../../auth/models/response/identity-token.response"; +import { KeysRequest } from "../../../models/request/keys.request"; +import { KeyGenerationService } from "../../../platform/abstractions/key-generation.service"; +import { LogService } from "../../../platform/abstractions/log.service"; +import { Utils } from "../../../platform/misc/utils"; +import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key"; import { ActiveUserState, KEY_CONNECTOR_DISK, StateProvider, UserKeyDefinition, -} from "../../platform/state"; -import { UserId } from "../../types/guid"; -import { MasterKey } from "../../types/key"; +} from "../../../platform/state"; +import { UserId } from "../../../types/guid"; +import { MasterKey } from "../../../types/key"; import { KeyConnectorService as KeyConnectorServiceAbstraction } from "../abstractions/key-connector.service"; -import { InternalMasterPasswordServiceAbstraction } from "../abstractions/master-password.service.abstraction"; -import { TokenService } from "../abstractions/token.service"; -import { KeyConnectorUserKeyRequest } from "../models/request/key-connector-user-key.request"; -import { SetKeyConnectorKeyRequest } from "../models/request/set-key-connector-key.request"; -import { IdentityTokenResponse } from "../models/response/identity-token.response"; +import { KeyConnectorUserKeyRequest } from "../models/key-connector-user-key.request"; +import { SetKeyConnectorKeyRequest } from "../models/set-key-connector-key.request"; export const USES_KEY_CONNECTOR = new UserKeyDefinition( KEY_CONNECTOR_DISK, diff --git a/libs/common/src/platform/sync/default-sync.service.ts b/libs/common/src/platform/sync/default-sync.service.ts index b47f0c54208..fa9fe1be2df 100644 --- a/libs/common/src/platform/sync/default-sync.service.ts +++ b/libs/common/src/platform/sync/default-sync.service.ts @@ -27,13 +27,13 @@ import { PolicyResponse } from "../../admin-console/models/response/policy.respo import { AccountService } from "../../auth/abstractions/account.service"; import { AuthService } from "../../auth/abstractions/auth.service"; import { AvatarService } from "../../auth/abstractions/avatar.service"; -import { KeyConnectorService } from "../../auth/abstractions/key-connector.service"; import { InternalMasterPasswordServiceAbstraction } from "../../auth/abstractions/master-password.service.abstraction"; import { TokenService } from "../../auth/abstractions/token.service"; import { AuthenticationStatus } from "../../auth/enums/authentication-status"; import { ForceSetPasswordReason } from "../../auth/models/domain/force-set-password-reason"; import { DomainSettingsService } from "../../autofill/services/domain-settings.service"; import { BillingAccountProfileStateService } from "../../billing/abstractions"; +import { KeyConnectorService } from "../../key-management/key-connector/abstractions/key-connector.service"; import { DomainsResponse } from "../../models/response/domains.response"; import { ProfileResponse } from "../../models/response/profile.response"; import { SendData } from "../../tools/send/models/data/send.data"; diff --git a/libs/common/src/services/api.service.ts b/libs/common/src/services/api.service.ts index 93e455ada80..b1e6f40b89e 100644 --- a/libs/common/src/services/api.service.ts +++ b/libs/common/src/services/api.service.ts @@ -53,11 +53,9 @@ import { SsoTokenRequest } from "../auth/models/request/identity-token/sso-token import { TokenTwoFactorRequest } from "../auth/models/request/identity-token/token-two-factor.request"; import { UserApiTokenRequest } from "../auth/models/request/identity-token/user-api-token.request"; import { WebAuthnLoginTokenRequest } from "../auth/models/request/identity-token/webauthn-login-token.request"; -import { KeyConnectorUserKeyRequest } from "../auth/models/request/key-connector-user-key.request"; import { PasswordHintRequest } from "../auth/models/request/password-hint.request"; import { PasswordlessAuthRequest } from "../auth/models/request/passwordless-auth.request"; import { SecretVerificationRequest } from "../auth/models/request/secret-verification.request"; -import { SetKeyConnectorKeyRequest } from "../auth/models/request/set-key-connector-key.request"; import { TwoFactorEmailRequest } from "../auth/models/request/two-factor-email.request"; import { TwoFactorProviderRequest } from "../auth/models/request/two-factor-provider.request"; import { TwoFactorRecoveryRequest } from "../auth/models/request/two-factor-recovery.request"; @@ -99,6 +97,8 @@ import { PlanResponse } from "../billing/models/response/plan.response"; import { SubscriptionResponse } from "../billing/models/response/subscription.response"; import { TaxInfoResponse } from "../billing/models/response/tax-info.response"; import { DeviceType } from "../enums"; +import { KeyConnectorUserKeyRequest } from "../key-management/key-connector/models/key-connector-user-key.request"; +import { SetKeyConnectorKeyRequest } from "../key-management/key-connector/models/set-key-connector-key.request"; import { VaultTimeoutSettingsService } from "../key-management/vault-timeout"; import { VaultTimeoutAction } from "../key-management/vault-timeout/enums/vault-timeout-action.enum"; import { CollectionBulkDeleteRequest } from "../models/request/collection-bulk-delete.request";