From 2bb4d5282262867908ce588740687484ad216295 Mon Sep 17 00:00:00 2001 From: gbubemismith Date: Tue, 8 Aug 2023 10:43:00 -0400 Subject: [PATCH] cleanup and removed unused references --- apps/browser/src/background/main.background.ts | 4 +--- .../browser-fido2-user-interface.service.ts | 16 +--------------- .../fido2-user-interface.service.abstraction.ts | 1 - .../fido2/fido2-authenticator.service.ts | 6 ++---- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 659b2a5dd5f..89d335a40ac 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -530,13 +530,11 @@ export default class MainBackground { this.popupUtilsService = new PopupUtilsService(this.isPrivateMode); this.fido2UserInterfaceService = new BrowserFido2UserInterfaceService( this.popupUtilsService, - this.authService, - this.syncService + this.authService ); this.fido2AuthenticatorService = new Fido2AuthenticatorService( this.cipherService, this.fido2UserInterfaceService, - this.authService, this.logService ); this.fido2ClientService = new Fido2ClientService( diff --git a/apps/browser/src/services/fido2/browser-fido2-user-interface.service.ts b/apps/browser/src/services/fido2/browser-fido2-user-interface.service.ts index 7f9651ea918..bfabfccfd6a 100644 --- a/apps/browser/src/services/fido2/browser-fido2-user-interface.service.ts +++ b/apps/browser/src/services/fido2/browser-fido2-user-interface.service.ts @@ -24,7 +24,6 @@ import { NewCredentialParams, PickCredentialParams, } from "@bitwarden/common/vault/abstractions/fido2/fido2-user-interface.service.abstraction"; -import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { BrowserApi } from "../../platform/browser/browser-api"; import { Popout, PopupUtilsService } from "../../popup/services/popup-utils.service"; @@ -112,11 +111,7 @@ export type BrowserFido2Message = { sessionId: string } & ( ); export class BrowserFido2UserInterfaceService implements Fido2UserInterfaceServiceAbstraction { - constructor( - private popupUtilsService: PopupUtilsService, - private authService: AuthService, - private syncService: SyncService - ) {} + constructor(private popupUtilsService: PopupUtilsService, private authService: AuthService) {} async newSession( fallbackSupported: boolean, @@ -125,7 +120,6 @@ export class BrowserFido2UserInterfaceService implements Fido2UserInterfaceServi return await BrowserFido2UserInterfaceSession.create( this.popupUtilsService, this.authService, - this.syncService, fallbackSupported, abortController ); @@ -136,14 +130,12 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi static async create( popupUtilsService: PopupUtilsService, authService: AuthService, - syncService: SyncService, fallbackSupported: boolean, abortController?: AbortController ): Promise { return new BrowserFido2UserInterfaceSession( popupUtilsService, authService, - syncService, fallbackSupported, abortController ); @@ -166,7 +158,6 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi private constructor( private readonly popupUtilsService: PopupUtilsService, private readonly authService: AuthService, - private readonly syncService: SyncService, private readonly fallbackSupported: boolean, readonly abortController = new AbortController(), readonly sessionId = Utils.newGuid() @@ -300,11 +291,6 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi async ensureUnlockedVault(): Promise { await this.connect(); - // await this.syncService.fullSync(false); - } - - async fullSync(): Promise { - await this.syncService.fullSync(false); } async informCredentialNotFound(): Promise { diff --git a/libs/common/src/vault/abstractions/fido2/fido2-user-interface.service.abstraction.ts b/libs/common/src/vault/abstractions/fido2/fido2-user-interface.service.abstraction.ts index fad47f5f58b..46492b38133 100644 --- a/libs/common/src/vault/abstractions/fido2/fido2-user-interface.service.abstraction.ts +++ b/libs/common/src/vault/abstractions/fido2/fido2-user-interface.service.abstraction.ts @@ -33,7 +33,6 @@ export abstract class Fido2UserInterfaceSession { abortController?: AbortController ) => Promise<{ cipherId: string; userVerified: boolean }>; ensureUnlockedVault: () => Promise; - fullSync: () => Promise; informExcludedCredential: ( existingCipherIds: string[], abortController?: AbortController diff --git a/libs/common/src/vault/services/fido2/fido2-authenticator.service.ts b/libs/common/src/vault/services/fido2/fido2-authenticator.service.ts index f506a0747a7..843bd034e47 100644 --- a/libs/common/src/vault/services/fido2/fido2-authenticator.service.ts +++ b/libs/common/src/vault/services/fido2/fido2-authenticator.service.ts @@ -1,6 +1,5 @@ import { CBOR } from "cbor-redux"; -import { AuthService } from "../../../auth/abstractions/auth.service"; import { LogService } from "../../../platform/abstractions/log.service"; import { Utils } from "../../../platform/misc/utils"; import { CipherService } from "../../abstractions/cipher.service"; @@ -38,7 +37,6 @@ export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstr constructor( private cipherService: CipherService, private userInterface: Fido2UserInterfaceService, - private authService: AuthService, private logService?: LogService ) {} async makeCredential( @@ -235,8 +233,8 @@ export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstr let cipherOptions: CipherView[]; - //TODO: add here - await userInterfaceSession.ensureUnlockedVault(); + //TODO: uncomment this when working on the login flow ticket + // await userInterfaceSession.ensureUnlockedVault(); // eslint-disable-next-line no-empty if (params.allowCredentialDescriptorList?.length > 0) {