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') 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 From 689cd00703cf7dcec1ce6437cd014bff2966c75f Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 30 Jan 2021 11:18:49 -0800 Subject: Fix credProps extension input --- packages/typescript-types/src/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'packages/typescript-types') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 5ab574f..012611f 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -152,10 +152,7 @@ export interface AuthenticatorAttestationResponseFuture extends AuthenticatorAtt export interface CredentialCreationExtensionsInputJSON { appidExclude?: string; uvm?: boolean; - credProps?: { - first: Base64URLString; - second?: Base64URLString; - }; + credProps?: boolean; prf?: { eval?: { first: Base64URLString; -- cgit v1.2.3 From 119609521b031445fbfd8134b2b493af0d22d5aa Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 5 Feb 2021 10:15:25 -0800 Subject: Remove custom extension types These types have been updated in TypeScript itself so we can reference them instead --- packages/typescript-types/src/index.ts | 72 ---------------------------------- 1 file changed, 72 deletions(-) (limited to 'packages/typescript-types') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 012611f..25d4203 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -144,75 +144,3 @@ export interface AuthenticatorAttestationResponseFuture extends AuthenticatorAtt getPublicKey?: () => ArrayBuffer; getPublicKeyAlgorithm?: () => COSEAlgorithmIdentifier[]; } - -/** - * Client Extensions - Attestation (Registration) - */ - -export interface CredentialCreationExtensionsInputJSON { - appidExclude?: string; - uvm?: boolean; - credProps?: boolean; - 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 From 503850a0492e6768a60dbce18d038eb9cf76f5ea Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 5 Feb 2021 10:16:06 -0800 Subject: Include AuthenticationExtensionsClientOutputs --- packages/typescript-types/extract-dom-types.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/typescript-types') diff --git a/packages/typescript-types/extract-dom-types.ts b/packages/typescript-types/extract-dom-types.ts index bc16554..856cb63 100644 --- a/packages/typescript-types/extract-dom-types.ts +++ b/packages/typescript-types/extract-dom-types.ts @@ -22,6 +22,7 @@ const types = [ 'AuthenticatorAttestationResponse', 'AuthenticatorTransport', 'AuthenticationExtensionsClientInputs', + 'AuthenticationExtensionsClientOutputs', 'AuthenticatorSelectionCriteria', 'COSEAlgorithmIdentifier', 'PublicKeyCredential', -- cgit v1.2.3 From 58e2c0bce0e82da6466a543e284a8eceb39fe071 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Fri, 5 Feb 2021 10:16:51 -0800 Subject: Update JSON types with DOM extension types --- packages/typescript-types/src/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'packages/typescript-types') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 25d4203..9d8a856 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -13,6 +13,8 @@ import type { PublicKeyCredentialDescriptor, PublicKeyCredentialRequestOptions, PublicKeyCredentialUserEntity, + AuthenticationExtensionsClientInputs, + AuthenticationExtensionsClientOutputs, } from './dom'; export * from './dom'; @@ -26,7 +28,7 @@ export interface PublicKeyCredentialCreationOptionsJSON user: PublicKeyCredentialUserEntityJSON; challenge: Base64URLString; excludeCredentials: PublicKeyCredentialDescriptorJSON[]; - extensions?: CredentialCreationExtensionsInputJSON; + extensions?: AuthenticationExtensionsClientInputs; } /** @@ -37,7 +39,7 @@ export interface PublicKeyCredentialRequestOptionsJSON extends Omit { challenge: Base64URLString; allowCredentials?: PublicKeyCredentialDescriptorJSON[]; - extensions?: CredentialRequestExtensionsInputJSON; + extensions?: AuthenticationExtensionsClientInputs; } export interface PublicKeyCredentialDescriptorJSON @@ -66,7 +68,7 @@ export interface AttestationCredentialJSON rawId: Base64URLString; response: AuthenticatorAttestationResponseJSON; transports?: AuthenticatorTransport[]; - clientExtensionResults?: CredentialCreationExtensionsOutputJSON; + clientExtensionResults?: AuthenticationExtensionsClientOutputs; } /** @@ -84,7 +86,7 @@ export interface AssertionCredentialJSON extends Omit { rawId: Base64URLString; response: AuthenticatorAssertionResponseJSON; - clientExtensionResults?: CredentialRequestExtensionsOutputJSON; + clientExtensionResults?: AuthenticationExtensionsClientOutputs; } /** -- cgit v1.2.3 From 8412b4edc5e77018a6ec5c289883c62f46e100a4 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 6 Feb 2021 15:22:29 -0800 Subject: Remove optional from clientExtensionResults type --- packages/typescript-types/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/typescript-types') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 9d8a856..ab39bd6 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -67,8 +67,8 @@ export interface AttestationCredentialJSON extends Omit { rawId: Base64URLString; response: AuthenticatorAttestationResponseJSON; + clientExtensionResults: AuthenticationExtensionsClientOutputs; transports?: AuthenticatorTransport[]; - clientExtensionResults?: AuthenticationExtensionsClientOutputs; } /** @@ -86,7 +86,7 @@ export interface AssertionCredentialJSON extends Omit { rawId: Base64URLString; response: AuthenticatorAssertionResponseJSON; - clientExtensionResults?: AuthenticationExtensionsClientOutputs; + clientExtensionResults: AuthenticationExtensionsClientOutputs; } /** -- cgit v1.2.3