Documentation ¶
Overview ¶
Package webauthn implements the WebAuthn domain. This domain allows configuring virtual authenticators to test the WebAuthn API.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type AddCredentialArgs
- type AddVirtualAuthenticatorArgs
- type AddVirtualAuthenticatorReply
- type AuthenticatorID
- type AuthenticatorProtocol
- type AuthenticatorTransport
- type CTAP2Version
- type ClearCredentialsArgs
- type Credential
- type EnableArgs
- type GetCredentialArgs
- type GetCredentialReply
- type GetCredentialsArgs
- type GetCredentialsReply
- type RemoveCredentialArgs
- type RemoveVirtualAuthenticatorArgs
- type SetAutomaticPresenceSimulationArgs
- type SetUserVerifiedArgs
- type VirtualAuthenticatorOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddCredentialArgs ¶ added in v0.23.4
type AddCredentialArgs struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description. Credential Credential `json:"credential"` // No description. }
AddCredentialArgs represents the arguments for AddCredential in the WebAuthn domain.
func NewAddCredentialArgs ¶ added in v0.23.4
func NewAddCredentialArgs(authenticatorID AuthenticatorID, credential Credential) *AddCredentialArgs
NewAddCredentialArgs initializes AddCredentialArgs with the required arguments.
type AddVirtualAuthenticatorArgs ¶
type AddVirtualAuthenticatorArgs struct {
Options VirtualAuthenticatorOptions `json:"options"` // No description.
}
AddVirtualAuthenticatorArgs represents the arguments for AddVirtualAuthenticator in the WebAuthn domain.
func NewAddVirtualAuthenticatorArgs ¶
func NewAddVirtualAuthenticatorArgs(options VirtualAuthenticatorOptions) *AddVirtualAuthenticatorArgs
NewAddVirtualAuthenticatorArgs initializes AddVirtualAuthenticatorArgs with the required arguments.
type AddVirtualAuthenticatorReply ¶
type AddVirtualAuthenticatorReply struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description.
}
AddVirtualAuthenticatorReply represents the return values for AddVirtualAuthenticator in the WebAuthn domain.
type AuthenticatorProtocol ¶
type AuthenticatorProtocol string
AuthenticatorProtocol
const ( AuthenticatorProtocolNotSet AuthenticatorProtocol = "" AuthenticatorProtocolU2F AuthenticatorProtocol = "u2f" AuthenticatorProtocolCTAP2 AuthenticatorProtocol = "ctap2" )
AuthenticatorProtocol as enums.
func (AuthenticatorProtocol) String ¶
func (e AuthenticatorProtocol) String() string
func (AuthenticatorProtocol) Valid ¶
func (e AuthenticatorProtocol) Valid() bool
type AuthenticatorTransport ¶
type AuthenticatorTransport string
AuthenticatorTransport
const ( AuthenticatorTransportNotSet AuthenticatorTransport = "" AuthenticatorTransportUSB AuthenticatorTransport = "usb" AuthenticatorTransportNFC AuthenticatorTransport = "nfc" AuthenticatorTransportBLE AuthenticatorTransport = "ble" AuthenticatorTransportCable AuthenticatorTransport = "cable" AuthenticatorTransportInternal AuthenticatorTransport = "internal" )
AuthenticatorTransport as enums.
func (AuthenticatorTransport) String ¶
func (e AuthenticatorTransport) String() string
func (AuthenticatorTransport) Valid ¶
func (e AuthenticatorTransport) Valid() bool
type CTAP2Version ¶ added in v0.31.0
type CTAP2Version string
CTAP2Version
const ( CTAP2VersionNotSet CTAP2Version = "" CTAP2VersionCTAP2_0 CTAP2Version = "ctap2_0" CTAP2VersionCTAP2_1 CTAP2Version = "ctap2_1" )
CTAP2Version as enums.
func (CTAP2Version) String ¶ added in v0.31.0
func (e CTAP2Version) String() string
func (CTAP2Version) Valid ¶ added in v0.31.0
func (e CTAP2Version) Valid() bool
type ClearCredentialsArgs ¶ added in v0.23.4
type ClearCredentialsArgs struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description.
}
ClearCredentialsArgs represents the arguments for ClearCredentials in the WebAuthn domain.
func NewClearCredentialsArgs ¶ added in v0.23.4
func NewClearCredentialsArgs(authenticatorID AuthenticatorID) *ClearCredentialsArgs
NewClearCredentialsArgs initializes ClearCredentialsArgs with the required arguments.
type Credential ¶ added in v0.23.4
type Credential struct { CredentialID string `json:"credentialId"` // No description. IsResidentCredential bool `json:"isResidentCredential"` // No description. RPID *string `json:"rpId,omitempty"` // 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. (Encoded as a base64 string when passed over JSON) UserHandle []byte `json:"userHandle,omitempty"` // An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user. (Encoded as a base64 string when passed over JSON) SignCount int `json:"signCount"` // Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter LargeBlob []byte `json:"largeBlob,omitempty"` // The large blob associated with the credential. See https://w3c.github.io/webauthn/#sctn-large-blob-extension (Encoded as a base64 string when passed over JSON) }
Credential
type EnableArgs ¶ added in v0.33.0
type EnableArgs struct {
EnableUI *bool `json:"enableUI,omitempty"` // 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.
}
EnableArgs represents the arguments for Enable in the WebAuthn domain.
func NewEnableArgs ¶ added in v0.33.0
func NewEnableArgs() *EnableArgs
NewEnableArgs initializes EnableArgs with the required arguments.
func (*EnableArgs) SetEnableUI ¶ added in v0.33.0
func (a *EnableArgs) SetEnableUI(enableUI bool) *EnableArgs
SetEnableUI sets the EnableUI optional argument. 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 GetCredentialArgs ¶ added in v0.25.0
type GetCredentialArgs struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description. CredentialID string `json:"credentialId"` // No description. }
GetCredentialArgs represents the arguments for GetCredential in the WebAuthn domain.
func NewGetCredentialArgs ¶ added in v0.25.0
func NewGetCredentialArgs(authenticatorID AuthenticatorID, credentialID string) *GetCredentialArgs
NewGetCredentialArgs initializes GetCredentialArgs with the required arguments.
type GetCredentialReply ¶ added in v0.25.0
type GetCredentialReply struct {
Credential Credential `json:"credential"` // No description.
}
GetCredentialReply represents the return values for GetCredential in the WebAuthn domain.
type GetCredentialsArgs ¶ added in v0.23.4
type GetCredentialsArgs struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description.
}
GetCredentialsArgs represents the arguments for GetCredentials in the WebAuthn domain.
func NewGetCredentialsArgs ¶ added in v0.23.4
func NewGetCredentialsArgs(authenticatorID AuthenticatorID) *GetCredentialsArgs
NewGetCredentialsArgs initializes GetCredentialsArgs with the required arguments.
type GetCredentialsReply ¶ added in v0.23.4
type GetCredentialsReply struct {
Credentials []Credential `json:"credentials"` // No description.
}
GetCredentialsReply represents the return values for GetCredentials in the WebAuthn domain.
type RemoveCredentialArgs ¶ added in v0.25.0
type RemoveCredentialArgs struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description. CredentialID string `json:"credentialId"` // No description. }
RemoveCredentialArgs represents the arguments for RemoveCredential in the WebAuthn domain.
func NewRemoveCredentialArgs ¶ added in v0.25.0
func NewRemoveCredentialArgs(authenticatorID AuthenticatorID, credentialID string) *RemoveCredentialArgs
NewRemoveCredentialArgs initializes RemoveCredentialArgs with the required arguments.
type RemoveVirtualAuthenticatorArgs ¶
type RemoveVirtualAuthenticatorArgs struct {
AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description.
}
RemoveVirtualAuthenticatorArgs represents the arguments for RemoveVirtualAuthenticator in the WebAuthn domain.
func NewRemoveVirtualAuthenticatorArgs ¶
func NewRemoveVirtualAuthenticatorArgs(authenticatorID AuthenticatorID) *RemoveVirtualAuthenticatorArgs
NewRemoveVirtualAuthenticatorArgs initializes RemoveVirtualAuthenticatorArgs with the required arguments.
type SetAutomaticPresenceSimulationArgs ¶ added in v0.31.0
type SetAutomaticPresenceSimulationArgs struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description. Enabled bool `json:"enabled"` // No description. }
SetAutomaticPresenceSimulationArgs represents the arguments for SetAutomaticPresenceSimulation in the WebAuthn domain.
func NewSetAutomaticPresenceSimulationArgs ¶ added in v0.31.0
func NewSetAutomaticPresenceSimulationArgs(authenticatorID AuthenticatorID, enabled bool) *SetAutomaticPresenceSimulationArgs
NewSetAutomaticPresenceSimulationArgs initializes SetAutomaticPresenceSimulationArgs with the required arguments.
type SetUserVerifiedArgs ¶ added in v0.24.1
type SetUserVerifiedArgs struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` // No description. IsUserVerified bool `json:"isUserVerified"` // No description. }
SetUserVerifiedArgs represents the arguments for SetUserVerified in the WebAuthn domain.
func NewSetUserVerifiedArgs ¶ added in v0.24.1
func NewSetUserVerifiedArgs(authenticatorID AuthenticatorID, isUserVerified bool) *SetUserVerifiedArgs
NewSetUserVerifiedArgs initializes SetUserVerifiedArgs with the required arguments.
type VirtualAuthenticatorOptions ¶
type VirtualAuthenticatorOptions struct { Protocol AuthenticatorProtocol `json:"protocol"` // No description. CTAP2Version CTAP2Version `json:"ctap2Version,omitempty"` // Defaults to ctap2_0. Ignored if |protocol| == u2f. Transport AuthenticatorTransport `json:"transport"` // No description. HasResidentKey *bool `json:"hasResidentKey,omitempty"` // Defaults to false. HasUserVerification *bool `json:"hasUserVerification,omitempty"` // Defaults to false. HasLargeBlob *bool `json:"hasLargeBlob,omitempty"` // 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"` // 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"` // 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. AutomaticPresenceSimulation *bool `json:"automaticPresenceSimulation,omitempty"` // 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"` // Sets whether User Verification succeeds or fails for an authenticator. Defaults to false. }
VirtualAuthenticatorOptions