summaryrefslogtreecommitdiffhomepage
path: root/packages/typescript-types/src
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-06-01 16:14:34 -0700
committerMatthew Miller <matthew@millerti.me>2020-06-01 16:14:34 -0700
commit2e31764344df57ec2a9176a74279a459f82729b4 (patch)
tree19373c48be0201acfc4a028480fbd31fd51de0c1 /packages/typescript-types/src
parent743de54fa9b0cbef261cdbedf1c567c2202737cd (diff)
Update types to reflect original response shape
Diffstat (limited to 'packages/typescript-types/src')
-rw-r--r--packages/typescript-types/src/index.ts26
1 files changed, 18 insertions, 8 deletions
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<AttestationCredential, 'response' | 'rawId'> {
+ 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<AssertionCredential, 'response' | 'rawId'> {
+ 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<AuthenticatorAttestationResponse, 'clientDataJSON' | 'attestationObject'> {
- 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 {