mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[EC-598] feat: half-implemented user interfacing
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export abstract class Fido2UserInterfaceService {
|
||||
verifyUser: () => Promise<boolean>;
|
||||
verifyPresence: () => Promise<boolean>;
|
||||
}
|
||||
@@ -34,6 +34,6 @@ export interface CredentialRegistrationParams {
|
||||
}
|
||||
|
||||
export abstract class Fido2Service {
|
||||
createCredential: (params: CredentialRegistrationParams) => unknown;
|
||||
createCredential: (params: CredentialRegistrationParams) => Promise<unknown>;
|
||||
assertCredential: () => unknown;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { Fido2UserInterfaceService } from "../../abstractions/fido2/fido2-user-interface.service.abstraction";
|
||||
import {
|
||||
CredentialRegistrationParams,
|
||||
Fido2Service as Fido2ServiceAbstraction,
|
||||
} from "../../abstractions/fido2/fido2.service.abstraction";
|
||||
|
||||
export class Fido2Service implements Fido2ServiceAbstraction {
|
||||
createCredential(params: CredentialRegistrationParams): unknown {
|
||||
constructor(private fido2UserInterfaceService: Fido2UserInterfaceService) {}
|
||||
|
||||
async createCredential(params: CredentialRegistrationParams): Promise<unknown> {
|
||||
await this.fido2UserInterfaceService.verifyPresence();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Fido2Service.registerCredential", params);
|
||||
return "createCredential response";
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Fido2UserInterfaceService as Fido2UserInterfaceServiceAbstraction } from "../../abstractions/fido2/fido2-user-interface.service.abstraction";
|
||||
|
||||
export class Fido2UserInterfaceService implements Fido2UserInterfaceServiceAbstraction {
|
||||
async verifyUser(): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
async verifyPresence(): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user