From c7fd25bd817a30d4f07fa9cd28287842a9aebb1e Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 7 Oct 2020 23:11:38 -0700 Subject: Start defining extension types --- packages/typescript-types/src/index.ts | 79 ++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) (limited to 'packages/typescript-types/src') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 8ba2297..5ab574f 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -26,6 +26,7 @@ export interface PublicKeyCredentialCreationOptionsJSON user: PublicKeyCredentialUserEntityJSON; challenge: Base64URLString; excludeCredentials: PublicKeyCredentialDescriptorJSON[]; + extensions?: CredentialCreationExtensionsInputJSON; } /** @@ -36,6 +37,7 @@ export interface PublicKeyCredentialRequestOptionsJSON extends Omit { challenge: Base64URLString; allowCredentials?: PublicKeyCredentialDescriptorJSON[]; + extensions?: CredentialRequestExtensionsInputJSON; } export interface PublicKeyCredentialDescriptorJSON @@ -64,6 +66,7 @@ export interface AttestationCredentialJSON rawId: Base64URLString; response: AuthenticatorAttestationResponseJSON; transports?: AuthenticatorTransport[]; + clientExtensionResults?: CredentialCreationExtensionsOutputJSON; } /** @@ -81,6 +84,7 @@ export interface AssertionCredentialJSON extends Omit { rawId: Base64URLString; response: AuthenticatorAssertionResponseJSON; + clientExtensionResults?: CredentialRequestExtensionsOutputJSON; } /** @@ -140,3 +144,78 @@ export interface AuthenticatorAttestationResponseFuture extends AuthenticatorAtt getPublicKey?: () => ArrayBuffer; getPublicKeyAlgorithm?: () => COSEAlgorithmIdentifier[]; } + +/** + * Client Extensions - Attestation (Registration) + */ + +export interface CredentialCreationExtensionsInputJSON { + appidExclude?: string; + uvm?: boolean; + credProps?: { + first: Base64URLString; + second?: Base64URLString; + }; + prf?: { + eval?: { + first: Base64URLString; + second?: Base64URLString; + }; + evalByCredential?: { + [base64CredID: string]: { first: Base64URLString; second?: Base64URLString }; + }; + }; +} + +export interface CredentialCreationExtensionsOutputJSON { + appidExclude?: boolean; + uvm?: Array<[number, number, number]>; + credProps?: { + rk: boolean; + }; + prf?: { + enabled?: boolean; + results?: { + first: Base64URLString; + second?: Base64URLString; + }; + }; +} + +/** + * Client Extensions - Assertion (Authentication) + */ + +export interface CredentialRequestExtensionsInputJSON { + appid?: string; + uvm?: boolean; + prf?: { + eval?: { + first: Base64URLString; + second?: Base64URLString; + }; + evalByCredential?: { + [base64CredID: string]: { first: Base64URLString; second?: Base64URLString }; + }; + }; + largeBlob?: { + read?: boolean; + write?: Base64URLString; + }; +} + +export interface CredentialRequestExtensionsOutputJSON { + appid?: boolean; + uvm?: Array<[number, number, number]>; + prf?: { + enabled?: boolean; + results?: { + first: Base64URLString; + second?: Base64URLString; + }; + }; + largeBlob?: { + blob?: Base64URLString; + written?: boolean; + }; +} -- cgit v1.2.3