Skip to content

Commit

Permalink
Commit test fixes that were missing from the published version commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jan 17, 2023
1 parent beac416 commit 461e8d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/webauthn-json/extended.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import {
import { convert } from "./convert";
import "./arraybuffer.jest";

const unimplemented: any = () => {
throw new Error("unimplemented");
};

describe("extended schema", () => {
test("converts CredentialCreationOptionsExtendedJSON", () => {
const cco: CredentialCreationOptionsExtendedJSON = {
Expand Down Expand Up @@ -63,6 +67,9 @@ describe("extended schema", () => {
response: {
clientDataJSON: new Uint8Array([9, 10, 11, 12]),
attestationObject: new Uint8Array([13, 14, 15, 16]),
getAuthenticatorData: unimplemented,
getPublicKey: unimplemented,
getPublicKeyAlgorithm: unimplemented,
getTransports: () => ["usb"],
} as AuthenticatorAttestationResponse,
getClientExtensionResults: () =>
Expand Down
9 changes: 6 additions & 3 deletions src/webauthn-json/extended/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import {
Base64urlString,
} from "../base64url";
import { convert } from "../convert";
import { AuthenticatorAttestationResponseJSON } from "../basic/json";
import {
AuthenticatorAttestationResponseJSON,
PublicKeyCredentialWithClientExtensionResults,
} from "../basic/json";
import {
CredentialCreationOptionsExtendedJSON,
CredentialRequestOptionsExtendedJSON,
Expand Down Expand Up @@ -33,7 +36,7 @@ export function createExtendedRequestFromJSON(
}

export function createExtendedResponseToJSON(
credential: PublicKeyCredential,
credential: PublicKeyCredentialWithClientExtensionResults,
): PublicKeyCredentialWithAttestationExtendedResultsJSON {
return convert(
bufferToBase64url,
Expand Down Expand Up @@ -113,7 +116,7 @@ export function getExtendedRequestFromJSON(
}

export function getExtendedResponseToJSON(
credential: PublicKeyCredential,
credential: PublicKeyCredentialWithClientExtensionResults,
): PublicKeyCredentialWithAssertionExtendedResultsJSON {
return convert(
bufferToBase64url,
Expand Down

0 comments on commit 461e8d6

Please # to comment.