Skip to content

Commit

Permalink
Merge pull request #652 from MasterKale/fix/639-update-json-types
Browse files Browse the repository at this point in the history
fix/639-update-json-types
  • Loading branch information
MasterKale authored Dec 6, 2024
2 parents 4463107 + 8e70604 commit b99e441
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export interface PublicKeyCredentialCreationOptionsJSON {
timeout?: number;
excludeCredentials?: PublicKeyCredentialDescriptorJSON[];
authenticatorSelection?: AuthenticatorSelectionCriteria;
hints?: PublicKeyCredentialHint[];
attestation?: AttestationConveyancePreference;
attestationFormats?: AttestationFormat[];
extensions?: AuthenticationExtensionsClientInputs;
}

Expand All @@ -75,6 +77,7 @@ export interface PublicKeyCredentialRequestOptionsJSON {
rpId?: string;
allowCredentials?: PublicKeyCredentialDescriptorJSON[];
userVerification?: UserVerificationRequirement;
hints?: PublicKeyCredentialHint[];
extensions?: AuthenticationExtensionsClientInputs;
}

Expand Down Expand Up @@ -255,3 +258,32 @@ export interface PublicKeyCredentialFuture extends PublicKeyCredential {
* - `"multiDevice"` credentials can be backed up
*/
export type CredentialDeviceType = 'singleDevice' | 'multiDevice';

/**
* Categories of authenticators that Relying Parties can pass along to browsers during
* registration. Browsers that understand these values can optimize their modal experience to
* start the user off in a particular registration flow:
*
* - `hybrid`: A platform authenticator on a mobile device
* - `security-key`: A portable FIDO2 authenticator capable of being used on multiple devices via a USB or NFC connection
* - `client-device`: The device that WebAuthn is being called on. Typically synonymous with platform authenticators
*
* See https://w3c.github.io/webauthn/#enumdef-publickeycredentialhint
*
* These values are less strict than `authenticatorAttachment`
*/
export type PublicKeyCredentialHint = 'hybrid' | 'security-key' | 'client-device';

/**
* Values for an attestation object's `fmt`
*
* See https://www.iana.org/assignments/webauthn/webauthn.xhtml#webauthn-attestation-statement-format-ids
*/
export type AttestationFormat =
| 'fido-u2f'
| 'packed'
| 'android-safetynet'
| 'android-key'
| 'tpm'
| 'apple'
| 'none';

0 comments on commit b99e441

Please sign in to comment.