From 4566757cfc71683040f455c37039ed7371ad7ff1 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 25 May 2020 23:25:57 -0700 Subject: Add new credential descriptor JSON type --- packages/typescript-types/src/index.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'packages/typescript-types/src') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index cab623c..3e52a5d 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -42,14 +42,8 @@ export type PublicKeyCredentialCreationOptionsJSON = { */ export type PublicKeyCredentialRequestOptionsJSON = { publicKey: { - // challenge: string; - allowCredentials: { - // Will be converted to a Uint8Array in the browser - id: string; - type: 'public-key'; - transports?: AuthenticatorTransport[]; - }[]; + allowCredentials: PublicKeyCredentialDescriptorJSON[]; // extensions?: AuthenticationExtensionsClientInputs, rpId?: string; timeout?: number; @@ -57,6 +51,13 @@ export type PublicKeyCredentialRequestOptionsJSON = { }; }; +export interface PublicKeyCredentialDescriptorJSON extends Omit< +PublicKeyCredentialDescriptor, 'id' +> { + // Should be a Base64-encoded credential ID. Will be converted to a Uint8Array in the browser + id: string; +} + /** * The value returned from navigator.credentials.create() */ -- cgit v1.2.3 From 916087c78ff525fbdf3a37e13c40276a3cf2d703 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Mon, 25 May 2020 23:26:40 -0700 Subject: Add excludeCredentials to attestation options type --- packages/typescript-types/src/index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/typescript-types/src') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 3e52a5d..353623e 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -28,6 +28,7 @@ export type PublicKeyCredentialCreationOptionsJSON = { ]; timeout?: number; attestation: 'direct' | 'indirect'; + excludeCredentials: PublicKeyCredentialDescriptorJSON[]; }; }; -- cgit v1.2.3