mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[EC-598] feat: half-implemented params mapping
This commit is contained in:
9
libs/common/src/abstractions/fido2/fido2-utils.ts
Normal file
9
libs/common/src/abstractions/fido2/fido2-utils.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class Fido2Utils {
|
||||
static bufferToString(buffer: BufferSource): string {
|
||||
return "";
|
||||
}
|
||||
|
||||
static stringToBuffer(str: string): Uint8Array {
|
||||
return new Uint8Array(0);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,35 @@
|
||||
export interface CredentialRegistrationParams {
|
||||
origin: string;
|
||||
attestation?: "direct" | "enterprise" | "indirect" | "none";
|
||||
authenticatorSelection?: {
|
||||
// authenticatorAttachment?: AuthenticatorAttachment; // not used
|
||||
requireResidentKey?: boolean;
|
||||
residentKey?: "discouraged" | "preferred" | "required";
|
||||
userVerification?: "discouraged" | "preferred" | "required";
|
||||
};
|
||||
challenge: string; // b64 encoded
|
||||
excludeCredentials?: {
|
||||
id: string; // b64 encoded
|
||||
transports?: ("ble" | "internal" | "nfc" | "usb")[];
|
||||
// type: "public-key"; // not used
|
||||
}[];
|
||||
extensions?: {
|
||||
appid?: string;
|
||||
appidExclude?: string;
|
||||
credProps?: boolean;
|
||||
uvm?: boolean;
|
||||
};
|
||||
pubKeyCredParams: {
|
||||
alg: number;
|
||||
// type: "public-key"; // not used
|
||||
}[];
|
||||
rp: {
|
||||
id?: string;
|
||||
name: string;
|
||||
};
|
||||
user: {
|
||||
id: string; // b64 encoded
|
||||
displayName: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
export class Fido2Service implements Fido2ServiceAbstraction {
|
||||
createCredential(params: CredentialRegistrationParams): unknown {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Fido2Service.registerCredential");
|
||||
console.log("Fido2Service.registerCredential", params);
|
||||
return "createCredential response";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user