mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
[EC-598] feat: first tested rule in new authentitcator
This commit is contained in:
@@ -1,12 +1,28 @@
|
||||
import { CipherService } from "../../vault/services/cipher.service";
|
||||
import {
|
||||
Fido2AuthenticatorMakeCredentialsParams,
|
||||
Fido2AuthenticatorService as Fido2AuthenticatorServiceAbstraction,
|
||||
} from "../abstractions/fido2-authenticator.service.abstraction";
|
||||
import { Fido2UserInterfaceService } from "../abstractions/fido2-user-interface.service.abstraction";
|
||||
import { Fido2Utils } from "../abstractions/fido2-utils";
|
||||
|
||||
/**
|
||||
* Bitwarden implementation of the Authenticator API described by the FIDO Alliance
|
||||
* https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html
|
||||
*/
|
||||
export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstraction {
|
||||
makeCredential: (params: Fido2AuthenticatorMakeCredentialsParams) => void;
|
||||
constructor(
|
||||
private cipherService: CipherService,
|
||||
private userInterface: Fido2UserInterfaceService
|
||||
) {}
|
||||
|
||||
async makeCredential(params: Fido2AuthenticatorMakeCredentialsParams): Promise<void> {
|
||||
this.userInterface.confirmDuplicateCredential(
|
||||
[Fido2Utils.bufferToString(params.excludeList[0].id)],
|
||||
{
|
||||
credentialName: params.rp.name,
|
||||
userName: params.user.name,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user