webauthn

package
v0.158.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 1 Imported by: 3

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 pdlgen command.

Index

Constants

View Source
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

AddCredential adds the credential to the specified authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addCredential

AddVirtualAuthenticator creates and adds a virtual authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addVirtualAuthenticator

ClearCredentials clears all the credentials from the specified device.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-clearCredentials

View Source
var CredentialAdded = cdp.Event[EventCredentialAdded]{Method: "WebAuthn.credentialAdded"}

CredentialAdded triggered when a credential is added to an authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialAdded

View Source
var CredentialAsserted = cdp.Event[EventCredentialAsserted]{Method: "WebAuthn.credentialAsserted"}

CredentialAsserted triggered when a credential is used in a webauthn assertion.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialAsserted

View Source
var CredentialDeleted = cdp.Event[EventCredentialDeleted]{Method: "WebAuthn.credentialDeleted"}

CredentialDeleted triggered when a credential is deleted, e.g. through PublicKeyCredential.signalUnknownCredential().

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialDeleted

View Source
var CredentialUpdated = cdp.Event[EventCredentialUpdated]{Method: "WebAuthn.credentialUpdated"}

CredentialUpdated triggered when a credential is updated, e.g. through PublicKeyCredential.signalCurrentUserDetails().

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#event-credentialUpdated

View Source
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}

Disable disable the WebAuthn domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-disable

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

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

GetCredentials returns all the credentials stored in the given virtual authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-getCredentials

RemoveCredential removes a credential from the authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeCredential

RemoveVirtualAuthenticator removes the given authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeVirtualAuthenticator

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.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-setAutomaticPresenceSimulation

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

SetResponseOverrideBits resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-setResponseOverrideBits

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

Functions

This section is empty.

Types

type AddCredentialParams

type AddCredentialParams struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId"`
	Credential      *Credential     `json:"credential"`
}

AddCredentialParams are the parameters of the command WebAuthn.addCredential.

type AddVirtualAuthenticatorParams

type AddVirtualAuthenticatorParams struct {
	Options *VirtualAuthenticatorOptions `json:"options"`
}

AddVirtualAuthenticatorParams are the parameters of the command WebAuthn.addVirtualAuthenticator.

type AddVirtualAuthenticatorResult added in v0.157.3

type AddVirtualAuthenticatorResult struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId,omitempty,omitzero"`
}

AddVirtualAuthenticatorResult is the result of the command WebAuthn.addVirtualAuthenticator.

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.

type AuthenticatorTransport

type AuthenticatorTransport string

AuthenticatorTransport LINT.IfChange(AuthenticatorTransport).

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-AuthenticatorTransport

const (
	AuthenticatorTransportUsb       AuthenticatorTransport = "usb"
	AuthenticatorTransportNfc       AuthenticatorTransport = "nfc"
	AuthenticatorTransportBle       AuthenticatorTransport = "ble"
	AuthenticatorTransportCable     AuthenticatorTransport = "cable"
	AuthenticatorTransportHybrid    AuthenticatorTransport = "hybrid"
	AuthenticatorTransportSmartCard AuthenticatorTransport = "smart-card"
	AuthenticatorTransportInternal  AuthenticatorTransport = "internal"
)

AuthenticatorTransport values.

func (AuthenticatorTransport) String

func (t AuthenticatorTransport) String() string

String returns the AuthenticatorTransport as string value.

type ClearCredentialsParams

type ClearCredentialsParams struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId"`
}

ClearCredentialsParams are the parameters of the command WebAuthn.clearCredentials.

type Credential

type Credential struct {
	CredentialID                   []byte   `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                     []byte   `json:"privateKey"`                            // The ECDSA P-256 private key in PKCS#8 format.
	UserHandle                     []byte   `json:"userHandle,omitempty,omitzero"`         // An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user.
	SignCount                      float64  `json:"signCount"`                             // Signature counter. Must be equal to or greater than -1. If -1, the credential won't have an associated signature counter, and every assertion operation will report a value of 0. See https://w3c.github.io/webauthn/#signature-counter
	LargeBlob                      []byte   `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"`                     // 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"`                           // 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
	CmtgKeys                       [][]byte `json:"cmtgKeys,omitempty,omitzero"`           // The CMTG keys associated with the credential.
	ActiveCmtgKeyIndex             *int64   `json:"activeCmtgKeyIndex,omitempty,omitzero"` // The 0-based index of the active key in cmtgKeys.
	GenerateCmtgKeyOnNextOperation bool     `json:"generateCmtgKeyOnNextOperation"`        // If true, the authenticator will generate a new CMTG key on the next operation.
}

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"
	Ctap2versionCtap22 Ctap2version = "ctap2_2"
)

Ctap2version values.

func (Ctap2version) String

func (t Ctap2version) String() string

String returns the Ctap2version as string value.

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 are the parameters of the command WebAuthn.enable.

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    []byte          `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    []byte          `json:"credentialId"`
}

GetCredentialParams are the parameters of the command WebAuthn.getCredential.

type GetCredentialResult added in v0.157.3

type GetCredentialResult struct {
	Credential *Credential `json:"credential,omitempty,omitzero"`
}

GetCredentialResult is the result of the command WebAuthn.getCredential.

type GetCredentialsParams

type GetCredentialsParams struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId"`
}

GetCredentialsParams are the parameters of the command WebAuthn.getCredentials.

type GetCredentialsResult added in v0.157.3

type GetCredentialsResult struct {
	Credentials []*Credential `json:"credentials,omitempty,omitzero"`
}

GetCredentialsResult is the result of the command WebAuthn.getCredentials.

type RemoveCredentialParams

type RemoveCredentialParams struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId"`
	CredentialID    []byte          `json:"credentialId"`
}

RemoveCredentialParams are the parameters of the command WebAuthn.removeCredential.

type RemoveVirtualAuthenticatorParams

type RemoveVirtualAuthenticatorParams struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId"`
}

RemoveVirtualAuthenticatorParams are the parameters of the command WebAuthn.removeVirtualAuthenticator.

type SetAutomaticPresenceSimulationParams

type SetAutomaticPresenceSimulationParams struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId"`
	Enabled         bool            `json:"enabled"`
}

SetAutomaticPresenceSimulationParams are the parameters of the command WebAuthn.setAutomaticPresenceSimulation.

type SetCredentialPropertiesParams

type SetCredentialPropertiesParams struct {
	AuthenticatorID                AuthenticatorID `json:"authenticatorId"`
	CredentialID                   []byte          `json:"credentialId"`
	BackupEligibility              *bool           `json:"backupEligibility,omitempty,omitzero"`
	BackupState                    *bool           `json:"backupState,omitempty,omitzero"`
	ActiveCmtgKeyIndex             *int64          `json:"activeCmtgKeyIndex,omitempty,omitzero"`
	GenerateCmtgKeyOnNextOperation *bool           `json:"generateCmtgKeyOnNextOperation,omitempty,omitzero"`
	SignCount                      *float64        `json:"signCount,omitempty,omitzero"` // Must be equal to or greater than -1. If -1, the signature counter is removed from the credential, and every assertion operation will report a value of 0. See https://w3c.github.io/webauthn/#signature-counter
}

SetCredentialPropertiesParams are the parameters of the command WebAuthn.setCredentialProperties.

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 are the parameters of the command WebAuthn.setResponseOverrideBits.

type SetUserVerifiedParams

type SetUserVerifiedParams struct {
	AuthenticatorID AuthenticatorID `json:"authenticatorId"`
	IsUserVerified  bool            `json:"isUserVerified"`
}

SetUserVerifiedParams are the parameters of the command WebAuthn.setUserVerified.

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"`              // Defaults to false.
	HasUserVerification         bool                   `json:"hasUserVerification"`         // Defaults to false.
	HasLargeBlob                bool                   `json:"hasLargeBlob"`                // If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.
	HasCredBlob                 bool                   `json:"hasCredBlob"`                 // 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"`             // 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"`                      // If set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.
	HasHmacSecret               bool                   `json:"hasHmacSecret"`               // If set to true, the authenticator will support the hmac-secret extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-hmac-secret-extension Defaults to false.
	HasHmacSecretMc             bool                   `json:"hasHmacSecretMc"`             // If set to true, the authenticator will support the hmac-secret-mc extension. https://fidoalliance.org/specs/fido-v2.2-rd-20241003/fido-client-to-authenticator-protocol-v2.2-rd-20241003.html#sctn-hmac-secret-make-cred-extension Defaults to false.
	HasCmtgKey                  bool                   `json:"hasCmtgKey"`                  // If set to true, the authenticator will support the cmtgKey (Credential Manager Trust Group Key) extension. https://github.com/w3c/webauthn/pull/2377 Defaults to false.
	AutomaticPresenceSimulation bool                   `json:"automaticPresenceSimulation"` // If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.
	IsUserVerified              bool                   `json:"isUserVerified"`              // Sets whether User Verification succeeds or fails for an authenticator. Defaults to false.
	DefaultBackupEligibility    bool                   `json:"defaultBackupEligibility"`    // 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"`          // 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL