-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add webauthn auth provider UI components
- Loading branch information
Showing
5 changed files
with
633 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
declare global { | ||
interface HASSDomEvents { | ||
"hass-refresh-passkeys": undefined; | ||
} | ||
} | ||
|
||
export interface Passkey { | ||
id: string; | ||
credential_id: string; | ||
name: string; | ||
created_at: string; | ||
last_used_at?: string; | ||
} | ||
|
||
export interface PublicKeyCredentialCreationOptionsJSON { | ||
rp: PublicKeyCredentialRpEntity; | ||
user: PublicKeyCredentialUserEntityJSON; | ||
challenge: string; | ||
pubKeyCredParams: PublicKeyCredentialParameters[]; | ||
timeout?: number; | ||
excludeCredentials: PublicKeyCredentialDescriptorJSON[]; | ||
authenticatorSelection?: AuthenticatorSelectionCriteria; | ||
attestation?: AttestationConveyancePreference; | ||
extensions?: AuthenticationExtensionsClientInputs; | ||
} | ||
|
||
export interface PublicKeyCredentialUserEntityJSON { | ||
id: string; | ||
name: string; | ||
displayName: string; | ||
} | ||
|
||
export interface PublicKeyCredentialDescriptorJSON { | ||
type: PublicKeyCredentialType; | ||
id: string; | ||
transports?: AuthenticatorTransport[]; | ||
} | ||
|
||
export interface PublicKeyCredentialCreationOptions { | ||
rp: PublicKeyCredentialRpEntity; | ||
user: PublicKeyCredentialUserEntity; | ||
challenge: BufferSource; | ||
pubKeyCredParams: PublicKeyCredentialParameters[]; | ||
timeout?: number; | ||
excludeCredentials?: PublicKeyCredentialDescriptor[]; | ||
authenticatorSelection?: AuthenticatorSelectionCriteria; | ||
attestation?: AttestationConveyancePreference; | ||
extensions?: AuthenticationExtensionsClientInputs; | ||
} | ||
|
||
export interface PublicKeyCredentialRequestOptionsJSON { | ||
id: string; | ||
challenge: string; | ||
timeout?: number; | ||
rpId?: string; | ||
allowCredentials: PublicKeyCredentialDescriptorJSON[]; | ||
userVerification?: UserVerificationRequirement; | ||
extensions?: AuthenticationExtensionsClientInputs; | ||
} | ||
|
||
export interface PublicKeyCredentialRequestOptions { | ||
id: string; | ||
challenge: BufferSource; | ||
timeout?: number; | ||
rpId?: string; | ||
allowCredentials?: PublicKeyCredentialDescriptor[]; | ||
userVerification?: UserVerificationRequirement; | ||
extensions?: AuthenticationExtensionsClientInputs; | ||
} | ||
|
||
export interface PublicKeyCredentialRpEntity { | ||
id: string; | ||
name: string; | ||
} | ||
|
||
export interface PublicKeyCredentialUserEntity { | ||
id: BufferSource; | ||
name: string; | ||
displayName: string; | ||
} | ||
|
||
export interface PublicKeyCredentialParameters { | ||
type: PublicKeyCredentialType; | ||
alg: COSEAlgorithmIdentifier; | ||
} | ||
|
||
export type PublicKeyCredentialType = "public-key"; | ||
|
||
export type COSEAlgorithmIdentifier = -7 | -257 | -65535 | -257 | -65535; | ||
|
||
export interface PublicKeyCredentialDescriptor { | ||
type: PublicKeyCredentialType; | ||
id: BufferSource; | ||
transports?: AuthenticatorTransport[]; | ||
} | ||
|
||
export type AuthenticatorTransport = "usb" | "nfc" | "ble" | "internal"; | ||
|
||
export type AuthenticatorAttachment = "platform" | "cross-platform"; | ||
|
||
export type UserVerificationRequirement = | ||
| "required" | ||
| "preferred" | ||
| "discouraged"; | ||
|
||
export interface AuthenticatorSelectionCriteria { | ||
authenticatorAttachment?: AuthenticatorAttachment; | ||
requireResidentKey?: boolean; | ||
userVerification?: UserVerificationRequirement; | ||
} | ||
|
||
export type AttestationConveyancePreference = "none" | "indirect" | "direct"; | ||
|
||
export interface AuthenticationExtensionsClientInputs { | ||
[key: string]: any; | ||
} | ||
|
||
export interface PublicKeyCredentialWithClientExtensionOutputs { | ||
clientExtensionResults: AuthenticationExtensionsClientOutputs; | ||
} | ||
|
||
export interface AuthenticationExtensionsClientOutputs { | ||
[key: string]: any; | ||
} | ||
|
||
export interface PublicKeyCredentialAttestationResponse { | ||
clientDataJSON: BufferSource; | ||
attestationObject: BufferSource; | ||
} | ||
|
||
export interface PublicKeyCredentialAssertionResponse { | ||
clientDataJSON: BufferSource; | ||
authenticatorData: BufferSource; | ||
signature: BufferSource; | ||
userHandle: BufferSource; | ||
} | ||
|
||
export interface PublicKeyRegistartionCredentialResponseJSON { | ||
authenticatorAttachment: string; | ||
id: string; | ||
rawId: string; | ||
response: PublicKeyCredentialAttestationResponseJSON; | ||
type: string; | ||
} | ||
|
||
export interface PublicKeyCredentialAttestationResponseJSON { | ||
clientDataJSON: string; | ||
attestationObject: string; | ||
} | ||
|
||
export interface PublicKeyRegistartionCredentialResponse { | ||
authenticatorAttachment: string; | ||
id: string; | ||
rawId: BufferSource; | ||
response: PublicKeyCredentialAttestationResponse; | ||
type: string; | ||
} | ||
|
||
export interface AuthenticationCredentialJSON { | ||
authenticatorAttachment: string; | ||
id: string; | ||
rawId: string; | ||
response: PublicKeyCredentialAssertionResponseJSON; | ||
type: string; | ||
} | ||
|
||
export interface PublicKeyCredentialAssertionResponseJSON { | ||
clientDataJSON: string; | ||
authenticatorData: string; | ||
signature: string; | ||
userHandle: string; | ||
} | ||
|
||
export interface AuthenticationCredential { | ||
authenticatorAttachment: string; | ||
id: string; | ||
rawId: BufferSource; | ||
response: PublicKeyCredentialAssertionResponse; | ||
type: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.