Documentation
¶
Overview ¶
Package webauthn provides the Chrome DevTools Protocol commands, types, and events for the WebAuthn domain.
This domain allows configuring virtual authenticators to test the WebAuthn API.
Generated by the cdproto-gen command.
Index ¶
- Constants
- type AddCredentialParams
- type AddVirtualAuthenticatorParams
- type AddVirtualAuthenticatorReturns
- type AuthenticatorID
- type AuthenticatorProtocol
- type AuthenticatorTransport
- type ClearCredentialsParams
- type Credential
- type Ctap2version
- type DisableParams
- type EnableParams
- type EventCredentialAdded
- type EventCredentialAsserted
- type EventCredentialDeleted
- type EventCredentialUpdated
- type GetCredentialParams
- type GetCredentialReturns
- type GetCredentialsParams
- type GetCredentialsReturns
- type RemoveCredentialParams
- type RemoveVirtualAuthenticatorParams
- type SetAutomaticPresenceSimulationParams
- type SetCredentialPropertiesParams
- type SetResponseOverrideBitsParams
- func (p *SetResponseOverrideBitsParams) Do(ctx context.Context) (err error)
- func (p SetResponseOverrideBitsParams) WithIsBadUP(isBadUP bool) *SetResponseOverrideBitsParams
- func (p SetResponseOverrideBitsParams) WithIsBadUV(isBadUV bool) *SetResponseOverrideBitsParams
- func (p SetResponseOverrideBitsParams) WithIsBogusSignature(isBogusSignature bool) *SetResponseOverrideBitsParams
- type SetUserVerifiedParams
- type VirtualAuthenticatorOptions
Constants ¶
const ( CommandEnable = "WebAuthn.enable" CommandDisable = "WebAuthn.disable" CommandAddVirtualAuthenticator = "WebAuthn.addVirtualAuthenticator" CommandSetResponseOverrideBits = "WebAuthn.setResponseOverrideBits" CommandRemoveVirtualAuthenticator = "WebAuthn.removeVirtualAuthenticator" CommandAddCredential = "WebAuthn.addCredential" CommandGetCredential = "WebAuthn.getCredential" CommandGetCredentials = "WebAuthn.getCredentials" CommandRemoveCredential = "WebAuthn.removeCredential" CommandClearCredentials = "WebAuthn.clearCredentials" CommandSetUserVerified = "WebAuthn.setUserVerified" CommandSetAutomaticPresenceSimulation = "WebAuthn.setAutomaticPresenceSimulation" CommandSetCredentialProperties = "WebAuthn.setCredentialProperties" )
Command names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddCredentialParams ¶
type AddCredentialParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` Credential *Credential `json:"credential"` }
AddCredentialParams adds the credential to the specified authenticator.
func AddCredential ¶
func AddCredential(authenticatorID AuthenticatorID, credential *Credential) *AddCredentialParams
AddCredential adds the credential to the specified authenticator.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addCredential
parameters:
authenticatorID credential
type AddVirtualAuthenticatorParams ¶
type AddVirtualAuthenticatorParams struct {
Options *VirtualAuthenticatorOptions `json:"options"`
}
AddVirtualAuthenticatorParams creates and adds a virtual authenticator.
func AddVirtualAuthenticator ¶
func AddVirtualAuthenticator(options *VirtualAuthenticatorOptions) *AddVirtualAuthenticatorParams
AddVirtualAuthenticator creates and adds a virtual authenticator.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addVirtualAuthenticator
parameters:
options
func (*AddVirtualAuthenticatorParams) Do ¶
func (p *AddVirtualAuthenticatorParams) Do(ctx context.Context) (authenticatorID AuthenticatorID, err error)
Do executes WebAuthn.addVirtualAuthenticator against the provided context.
returns:
authenticatorID
type AddVirtualAuthenticatorReturns ¶
type AddVirtualAuthenticatorReturns struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId,omitempty,omitzero"`
}
AddVirtualAuthenticatorReturns return values.
type AuthenticatorID ¶
type AuthenticatorID string
AuthenticatorID [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-AuthenticatorId
func (AuthenticatorID) String ¶
func (t AuthenticatorID) String() string
String returns the AuthenticatorID as string value.
type AuthenticatorProtocol ¶
type AuthenticatorProtocol string
AuthenticatorProtocol [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-AuthenticatorProtocol
const ( AuthenticatorProtocolU2f AuthenticatorProtocol = "u2f" AuthenticatorProtocolCtap2 AuthenticatorProtocol = "ctap2" )
AuthenticatorProtocol values.
func (AuthenticatorProtocol) String ¶
func (t AuthenticatorProtocol) String() string
String returns the AuthenticatorProtocol as string value.
func (*AuthenticatorProtocol) UnmarshalJSON ¶
func (t *AuthenticatorProtocol) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type AuthenticatorTransport ¶
type AuthenticatorTransport string
AuthenticatorTransport [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-AuthenticatorTransport
const ( AuthenticatorTransportUsb AuthenticatorTransport = "usb" AuthenticatorTransportNfc AuthenticatorTransport = "nfc" AuthenticatorTransportBle AuthenticatorTransport = "ble" AuthenticatorTransportCable AuthenticatorTransport = "cable" AuthenticatorTransportInternal AuthenticatorTransport = "internal" )
AuthenticatorTransport values.
func (AuthenticatorTransport) String ¶
func (t AuthenticatorTransport) String() string
String returns the AuthenticatorTransport as string value.
func (*AuthenticatorTransport) UnmarshalJSON ¶
func (t *AuthenticatorTransport) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type ClearCredentialsParams ¶
type ClearCredentialsParams struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId"`
}
ClearCredentialsParams clears all the credentials from the specified device.
func ClearCredentials ¶
func ClearCredentials(authenticatorID AuthenticatorID) *ClearCredentialsParams
ClearCredentials clears all the credentials from the specified device.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-clearCredentials
parameters:
authenticatorID
type Credential ¶
type Credential struct { CredentialID string `json:"credentialId"` IsResidentCredential bool `json:"isResidentCredential"` RpID string `json:"rpId,omitempty,omitzero"` // Relying Party ID the credential is scoped to. Must be set when adding a credential. PrivateKey string `json:"privateKey"` // The ECDSA P-256 private key in PKCS#8 format. UserHandle string `json:"userHandle,omitempty,omitzero"` // An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user. SignCount int64 `json:"signCount"` // Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter LargeBlob string `json:"largeBlob,omitempty,omitzero"` // The large blob associated with the credential. See https://w3c.github.io/webauthn/#sctn-large-blob-extension BackupEligibility bool `json:"backupEligibility,omitempty,omitzero"` // Assertions returned by this credential will have the backup eligibility (BE) flag set to this value. Defaults to the authenticator's defaultBackupEligibility value. BackupState bool `json:"backupState,omitempty,omitzero"` // Assertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator's defaultBackupState value. UserName string `json:"userName,omitempty,omitzero"` // The credential's user.name property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name UserDisplayName string `json:"userDisplayName,omitempty,omitzero"` // The credential's user.displayName property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname }
Credential [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-Credential
type Ctap2version ¶
type Ctap2version string
Ctap2version [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-Ctap2Version
const ( Ctap2versionCtap20 Ctap2version = "ctap2_0" Ctap2versionCtap21 Ctap2version = "ctap2_1" )
Ctap2version values.
func (Ctap2version) String ¶
func (t Ctap2version) String() string
String returns the Ctap2version as string value.
func (*Ctap2version) UnmarshalJSON ¶
func (t *Ctap2version) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies [json.Unmarshaler].
type DisableParams ¶
type DisableParams struct{}
DisableParams disable the WebAuthn domain.
func Disable ¶
func Disable() *DisableParams
Disable disable the WebAuthn domain.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-disable
type EnableParams ¶
type EnableParams struct {
EnableUI bool `json:"enableUI,omitempty,omitzero"` // Whether to enable the WebAuthn user interface. Enabling the UI is recommended for debugging and demo purposes, as it is closer to the real experience. Disabling the UI is recommended for automated testing. Supported at the embedder's discretion if UI is available. Defaults to false.
}
EnableParams enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.
func Enable ¶
func Enable() *EnableParams
Enable enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-enable
parameters:
func (*EnableParams) Do ¶
func (p *EnableParams) Do(ctx context.Context) (err error)
Do executes WebAuthn.enable against the provided context.
func (EnableParams) WithEnableUI ¶
func (p EnableParams) WithEnableUI(enableUI bool) *EnableParams
WithEnableUI whether to enable the WebAuthn user interface. Enabling the UI is recommended for debugging and demo purposes, as it is closer to the real experience. Disabling the UI is recommended for automated testing. Supported at the embedder's discretion if UI is available. Defaults to false.
type EventCredentialAdded ¶
type EventCredentialAdded struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` Credential *Credential `json:"credential"` }
EventCredentialAdded triggered when a credential is added to an authenticator.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialAdded
type EventCredentialAsserted ¶
type EventCredentialAsserted struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` Credential *Credential `json:"credential"` }
EventCredentialAsserted triggered when a credential is used in a webauthn assertion.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialAsserted
type EventCredentialDeleted ¶
type EventCredentialDeleted struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` CredentialID string `json:"credentialId"` }
EventCredentialDeleted triggered when a credential is deleted, e.g. through PublicKeyCredential.signalUnknownCredential().
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialDeleted
type EventCredentialUpdated ¶
type EventCredentialUpdated struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` Credential *Credential `json:"credential"` }
EventCredentialUpdated triggered when a credential is updated, e.g. through PublicKeyCredential.signalCurrentUserDetails().
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialUpdated
type GetCredentialParams ¶
type GetCredentialParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` CredentialID string `json:"credentialId"` }
GetCredentialParams returns a single credential stored in the given virtual authenticator that matches the credential ID.
func GetCredential ¶
func GetCredential(authenticatorID AuthenticatorID, credentialID string) *GetCredentialParams
GetCredential returns a single credential stored in the given virtual authenticator that matches the credential ID.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-getCredential
parameters:
authenticatorID credentialID
func (*GetCredentialParams) Do ¶
func (p *GetCredentialParams) Do(ctx context.Context) (credential *Credential, err error)
Do executes WebAuthn.getCredential against the provided context.
returns:
credential
type GetCredentialReturns ¶
type GetCredentialReturns struct {
Credential *Credential `json:"credential,omitempty,omitzero"`
}
GetCredentialReturns return values.
type GetCredentialsParams ¶
type GetCredentialsParams struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId"`
}
GetCredentialsParams returns all the credentials stored in the given virtual authenticator.
func GetCredentials ¶
func GetCredentials(authenticatorID AuthenticatorID) *GetCredentialsParams
GetCredentials returns all the credentials stored in the given virtual authenticator.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-getCredentials
parameters:
authenticatorID
func (*GetCredentialsParams) Do ¶
func (p *GetCredentialsParams) Do(ctx context.Context) (credentials []*Credential, err error)
Do executes WebAuthn.getCredentials against the provided context.
returns:
credentials
type GetCredentialsReturns ¶
type GetCredentialsReturns struct {
Credentials []*Credential `json:"credentials,omitempty,omitzero"`
}
GetCredentialsReturns return values.
type RemoveCredentialParams ¶
type RemoveCredentialParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` CredentialID string `json:"credentialId"` }
RemoveCredentialParams removes a credential from the authenticator.
func RemoveCredential ¶
func RemoveCredential(authenticatorID AuthenticatorID, credentialID string) *RemoveCredentialParams
RemoveCredential removes a credential from the authenticator.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeCredential
parameters:
authenticatorID credentialID
type RemoveVirtualAuthenticatorParams ¶
type RemoveVirtualAuthenticatorParams struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId"`
}
RemoveVirtualAuthenticatorParams removes the given authenticator.
func RemoveVirtualAuthenticator ¶
func RemoveVirtualAuthenticator(authenticatorID AuthenticatorID) *RemoveVirtualAuthenticatorParams
RemoveVirtualAuthenticator removes the given authenticator.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeVirtualAuthenticator
parameters:
authenticatorID
type SetAutomaticPresenceSimulationParams ¶
type SetAutomaticPresenceSimulationParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` Enabled bool `json:"enabled"` }
SetAutomaticPresenceSimulationParams sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.
func SetAutomaticPresenceSimulation ¶
func SetAutomaticPresenceSimulation(authenticatorID AuthenticatorID, enabled bool) *SetAutomaticPresenceSimulationParams
SetAutomaticPresenceSimulation sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.
parameters:
authenticatorID enabled
type SetCredentialPropertiesParams ¶
type SetCredentialPropertiesParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` CredentialID string `json:"credentialId"` BackupEligibility bool `json:"backupEligibility,omitempty,omitzero"` BackupState bool `json:"backupState,omitempty,omitzero"` }
SetCredentialPropertiesParams allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties.
func SetCredentialProperties ¶
func SetCredentialProperties(authenticatorID AuthenticatorID, credentialID string) *SetCredentialPropertiesParams
SetCredentialProperties allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-setCredentialProperties
parameters:
authenticatorID credentialID
func (*SetCredentialPropertiesParams) Do ¶
func (p *SetCredentialPropertiesParams) Do(ctx context.Context) (err error)
Do executes WebAuthn.setCredentialProperties against the provided context.
func (SetCredentialPropertiesParams) WithBackupEligibility ¶
func (p SetCredentialPropertiesParams) WithBackupEligibility(backupEligibility bool) *SetCredentialPropertiesParams
WithBackupEligibility [no description].
func (SetCredentialPropertiesParams) WithBackupState ¶
func (p SetCredentialPropertiesParams) WithBackupState(backupState bool) *SetCredentialPropertiesParams
WithBackupState [no description].
type SetResponseOverrideBitsParams ¶
type SetResponseOverrideBitsParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` IsBogusSignature bool `json:"isBogusSignature,omitempty,omitzero"` // If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false. IsBadUV bool `json:"isBadUV,omitempty,omitzero"` // If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false. IsBadUP bool `json:"isBadUP,omitempty,omitzero"` // If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false. }
SetResponseOverrideBitsParams resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
func SetResponseOverrideBits ¶
func SetResponseOverrideBits(authenticatorID AuthenticatorID) *SetResponseOverrideBitsParams
SetResponseOverrideBits resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-setResponseOverrideBits
parameters:
authenticatorID
func (*SetResponseOverrideBitsParams) Do ¶
func (p *SetResponseOverrideBitsParams) Do(ctx context.Context) (err error)
Do executes WebAuthn.setResponseOverrideBits against the provided context.
func (SetResponseOverrideBitsParams) WithIsBadUP ¶
func (p SetResponseOverrideBitsParams) WithIsBadUP(isBadUP bool) *SetResponseOverrideBitsParams
WithIsBadUP if isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false.
func (SetResponseOverrideBitsParams) WithIsBadUV ¶
func (p SetResponseOverrideBitsParams) WithIsBadUV(isBadUV bool) *SetResponseOverrideBitsParams
WithIsBadUV if isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false.
func (SetResponseOverrideBitsParams) WithIsBogusSignature ¶
func (p SetResponseOverrideBitsParams) WithIsBogusSignature(isBogusSignature bool) *SetResponseOverrideBitsParams
WithIsBogusSignature if isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false.
type SetUserVerifiedParams ¶
type SetUserVerifiedParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` IsUserVerified bool `json:"isUserVerified"` }
SetUserVerifiedParams sets whether User Verification succeeds or fails for an authenticator. The default is true.
func SetUserVerified ¶
func SetUserVerified(authenticatorID AuthenticatorID, isUserVerified bool) *SetUserVerifiedParams
SetUserVerified sets whether User Verification succeeds or fails for an authenticator. The default is true.
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-setUserVerified
parameters:
authenticatorID isUserVerified
type VirtualAuthenticatorOptions ¶
type VirtualAuthenticatorOptions struct { Protocol AuthenticatorProtocol `json:"protocol"` Ctap2version Ctap2version `json:"ctap2Version,omitempty,omitzero"` // Defaults to ctap2_0. Ignored if |protocol| == u2f. Transport AuthenticatorTransport `json:"transport"` HasResidentKey bool `json:"hasResidentKey,omitempty,omitzero"` // Defaults to false. HasUserVerification bool `json:"hasUserVerification,omitempty,omitzero"` // Defaults to false. HasLargeBlob bool `json:"hasLargeBlob,omitempty,omitzero"` // If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false. HasCredBlob bool `json:"hasCredBlob,omitempty,omitzero"` // If set to true, the authenticator will support the credBlob extension. https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension Defaults to false. HasMinPinLength bool `json:"hasMinPinLength,omitempty,omitzero"` // If set to true, the authenticator will support the minPinLength extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension Defaults to false. HasPrf bool `json:"hasPrf,omitempty,omitzero"` // If set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false. AutomaticPresenceSimulation bool `json:"automaticPresenceSimulation,omitempty,omitzero"` // If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true. IsUserVerified bool `json:"isUserVerified,omitempty,omitzero"` // Sets whether User Verification succeeds or fails for an authenticator. Defaults to false. DefaultBackupEligibility bool `json:"defaultBackupEligibility,omitempty,omitzero"` // Credentials created by this authenticator will have the backup eligibility (BE) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup DefaultBackupState bool `json:"defaultBackupState,omitempty,omitzero"` // Credentials created by this authenticator will have the backup state (BS) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup }
VirtualAuthenticatorOptions [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-VirtualAuthenticatorOptions