1
0
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:
Andreas Coroiu
2022-11-18 17:01:36 +01:00
parent dc91cfda69
commit def0015188
5 changed files with 89 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
export class Fido2Utils {
static bufferToString(buffer: BufferSource): string {
return "";
}
static stringToBuffer(str: string): Uint8Array {
return new Uint8Array(0);
}
}

View File

@@ -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;
};
}

View File

@@ -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";
}