From c9a2f07e04a1f6752fbf3d2950be6a7b8e9e8a59 Mon Sep 17 00:00:00 2001 From: Todd Martin <106564991+trmartin4@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:56:58 -0500 Subject: [PATCH] Remove Fido2VaultCredentials feature flag (#7463) * Removed Fido2 client credentials feature flag * Removed test for feature flag. --- libs/common/src/enums/feature-flag.enum.ts | 2 -- .../fido2/fido2-client.service.spec.ts | 21 ------------------- .../services/fido2/fido2-client.service.ts | 16 ++------------ 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index 0f3a3e9fcd..7f8ca7735e 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -1,6 +1,4 @@ export enum FeatureFlag { - DisplayLowKdfIterationWarningFlag = "display-kdf-iteration-warning", - Fido2VaultCredentials = "fido2-vault-credentials", TrustedDeviceEncryption = "trusted-device-encryption", PasswordlessLogin = "passwordless-login", AutofillV2 = "autofill-v2", diff --git a/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts b/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts index 1aab00752e..670d623d9f 100644 --- a/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts +++ b/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts @@ -42,7 +42,6 @@ describe("FidoAuthenticatorService", () => { stateService = mock(); client = new Fido2ClientService(authenticator, configService, authService, stateService); - configService.getFeatureFlag.mockResolvedValue(true); configService.serverConfig$ = of({ environment: { vault: VaultUrl } } as any); stateService.getEnablePasskeys.mockResolvedValue(true); authService.getAuthStatus.mockResolvedValue(AuthenticationStatus.Unlocked); @@ -225,16 +224,6 @@ describe("FidoAuthenticatorService", () => { await rejects.toBeInstanceOf(DOMException); }); - it("should throw FallbackRequestedError if feature flag is not enabled", async () => { - const params = createParams(); - configService.getFeatureFlag.mockResolvedValue(false); - - const result = async () => await client.createCredential(params, tab); - - const rejects = expect(result).rejects; - await rejects.toThrow(FallbackRequestedError); - }); - it("should throw FallbackRequestedError if passkeys state is not enabled", async () => { const params = createParams(); stateService.getEnablePasskeys.mockResolvedValue(false); @@ -405,16 +394,6 @@ describe("FidoAuthenticatorService", () => { await rejects.toBeInstanceOf(DOMException); }); - it("should throw FallbackRequestedError if feature flag is not enabled", async () => { - const params = createParams(); - configService.getFeatureFlag.mockResolvedValue(false); - - const result = async () => await client.assertCredential(params, tab); - - const rejects = expect(result).rejects; - await rejects.toThrow(FallbackRequestedError); - }); - it("should throw FallbackRequestedError if passkeys state is not enabled", async () => { const params = createParams(); stateService.getEnablePasskeys.mockResolvedValue(false); diff --git a/libs/common/src/vault/services/fido2/fido2-client.service.ts b/libs/common/src/vault/services/fido2/fido2-client.service.ts index 283a82ec59..836afdd1c9 100644 --- a/libs/common/src/vault/services/fido2/fido2-client.service.ts +++ b/libs/common/src/vault/services/fido2/fido2-client.service.ts @@ -3,7 +3,6 @@ import { parse } from "tldts"; import { AuthService } from "../../../auth/abstractions/auth.service"; import { AuthenticationStatus } from "../../../auth/enums/authentication-status"; -import { FeatureFlag } from "../../../enums/feature-flag.enum"; import { ConfigServiceAbstraction } from "../../../platform/abstractions/config/config.service.abstraction"; import { LogService } from "../../../platform/abstractions/log.service"; import { StateService } from "../../../platform/abstractions/state.service"; @@ -57,20 +56,9 @@ export class Fido2ClientService implements Fido2ClientServiceAbstraction { const serverConfig = await firstValueFrom(this.configService.serverConfig$); const isOriginEqualBitwardenVault = origin === serverConfig.environment?.vault; - if ( - !userEnabledPasskeys || - !isUserLoggedIn || - isExcludedDomain || - isOriginEqualBitwardenVault - ) { - return false; - } - - const featureFlagEnabled = await this.configService.getFeatureFlag( - FeatureFlag.Fido2VaultCredentials, + return ( + userEnabledPasskeys && isUserLoggedIn && !isExcludedDomain && !isOriginEqualBitwardenVault ); - - return featureFlagEnabled; } async createCredential(