summaryrefslogtreecommitdiffhomepage
path: root/packages/typescript-types
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-10-07 23:11:38 -0700
committerMatthew Miller <matthew@millerti.me>2021-02-05 09:57:48 -0800
commitc7fd25bd817a30d4f07fa9cd28287842a9aebb1e (patch)
tree144c208cc368db8dba546d1226989dff04c5d87b /packages/typescript-types
parent4bfe5bbb1a78e7e3667d81362ededb9637fecdc4 (diff)
Start defining extension types
Diffstat (limited to 'packages/typescript-types')
-rw-r--r--packages/typescript-types/src/index.ts79
1 files changed, 79 insertions, 0 deletions
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<PublicKeyCredentialRequestOptions, 'challenge' | 'allowCredentials'> {
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<AssertionCredential, 'response' | 'rawId' | 'getClientExtensionResults'> {
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;
+ };
+}