From 2e31764344df57ec2a9176a74279a459f82729b4 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 1 Jun 2020 16:14:34 -0700 Subject: Update types to reflect original response shape --- packages/typescript-types/src/index.ts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'packages/typescript-types/src') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index dcd88a9..235fcfb 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -49,6 +49,12 @@ export interface AttestationCredential extends PublicKeyCredential { response: AuthenticatorAttestationResponse; } +export interface AttestationCredentialJSON + extends Omit { + rawId: string; + response: AuthenticatorAttestationResponseJSON; +} + /** * The value returned from navigator.credentials.get() */ @@ -56,14 +62,19 @@ export interface AssertionCredential extends PublicKeyCredential { response: AuthenticatorAssertionResponse; } +export interface AssertionCredentialJSON extends Omit { + rawId: string; + response: AuthenticatorAssertionResponseJSON; +} + /** * A slightly-modified AuthenticatorAttestationResponse to simplify working with ArrayBuffers that * are base64-encoded in the browser so that they can be sent as JSON to the server. */ export interface AuthenticatorAttestationResponseJSON extends Omit { - base64ClientDataJSON: string; - base64AttestationObject: string; + clientDataJSON: string; + attestationObject: string; } /** @@ -73,13 +84,12 @@ export interface AuthenticatorAttestationResponseJSON export interface AuthenticatorAssertionResponseJSON extends Omit< AuthenticatorAssertionResponse, - 'clientDataJSON' | 'authenticatorData' | 'signature' | 'userHandle' + 'authenticatorData' | 'clientDataJSON' | 'signature' | 'userHandle' > { - base64CredentialID: string; - base64AuthenticatorData: string; - base64ClientDataJSON: string; - base64Signature: string; - base64UserHandle?: string; + authenticatorData: string; + clientDataJSON: string; + signature: string; + userHandle?: string; } export enum ATTESTATION_FORMATS { -- cgit v1.2.3