// 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.
package webauthn // Code generated by cdproto-gen. DO NOT EDIT. import ( ) // EnableParams enable the WebAuthn domain and start intercepting credential // storage and retrieval with a virtual authenticator. type EnableParams 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. } // 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 { return &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. func ( EnableParams) ( bool) *EnableParams { .EnableUI = return & } // Do executes WebAuthn.enable against the provided context. func ( *EnableParams) ( context.Context) ( error) { return cdp.Execute(, CommandEnable, , nil) } // DisableParams disable the WebAuthn domain. type DisableParams struct{} // Disable disable the WebAuthn domain. // // See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-disable func () *DisableParams { return &DisableParams{} } // Do executes WebAuthn.disable against the provided context. func ( *DisableParams) ( context.Context) ( error) { return cdp.Execute(, CommandDisable, nil, nil) } // AddVirtualAuthenticatorParams creates and adds a virtual authenticator. type AddVirtualAuthenticatorParams struct { Options *VirtualAuthenticatorOptions `json:"options"` } // AddVirtualAuthenticator creates and adds a virtual authenticator. // // See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addVirtualAuthenticator // // parameters: // // options func ( *VirtualAuthenticatorOptions) *AddVirtualAuthenticatorParams { return &AddVirtualAuthenticatorParams{ Options: , } } // AddVirtualAuthenticatorReturns return values. type AddVirtualAuthenticatorReturns struct { AuthenticatorID AuthenticatorID `json:"authenticatorId,omitempty"` } // Do executes WebAuthn.addVirtualAuthenticator against the provided context. // // returns: // // authenticatorID func ( *AddVirtualAuthenticatorParams) ( context.Context) ( AuthenticatorID, error) { // execute var AddVirtualAuthenticatorReturns = cdp.Execute(, CommandAddVirtualAuthenticator, , &) if != nil { return "", } return .AuthenticatorID, nil } // SetResponseOverrideBitsParams resets parameters isBogusSignature, isBadUV, // isBadUP to false if they are not present. type SetResponseOverrideBitsParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` IsBogusSignature bool `json:"isBogusSignature,omitempty"` // If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false. IsBadUV bool `json:"isBadUV,omitempty"` // 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"` // If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false. } // 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 ( AuthenticatorID) *SetResponseOverrideBitsParams { return &SetResponseOverrideBitsParams{ AuthenticatorID: , } } // WithIsBogusSignature if isBogusSignature is set, overrides the signature // in the authenticator response to be zero. Defaults to false. func ( SetResponseOverrideBitsParams) ( bool) *SetResponseOverrideBitsParams { .IsBogusSignature = return & } // WithIsBadUV if isBadUV is set, overrides the UV bit in the flags in the // authenticator response to be zero. Defaults to false. func ( SetResponseOverrideBitsParams) ( bool) *SetResponseOverrideBitsParams { .IsBadUV = return & } // WithIsBadUP if isBadUP is set, overrides the UP bit in the flags in the // authenticator response to be zero. Defaults to false. func ( SetResponseOverrideBitsParams) ( bool) *SetResponseOverrideBitsParams { .IsBadUP = return & } // Do executes WebAuthn.setResponseOverrideBits against the provided context. func ( *SetResponseOverrideBitsParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetResponseOverrideBits, , nil) } // RemoveVirtualAuthenticatorParams removes the given authenticator. type RemoveVirtualAuthenticatorParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` } // RemoveVirtualAuthenticator removes the given authenticator. // // See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeVirtualAuthenticator // // parameters: // // authenticatorID func ( AuthenticatorID) *RemoveVirtualAuthenticatorParams { return &RemoveVirtualAuthenticatorParams{ AuthenticatorID: , } } // Do executes WebAuthn.removeVirtualAuthenticator against the provided context. func ( *RemoveVirtualAuthenticatorParams) ( context.Context) ( error) { return cdp.Execute(, CommandRemoveVirtualAuthenticator, , nil) } // AddCredentialParams adds the credential to the specified authenticator. type AddCredentialParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` Credential *Credential `json:"credential"` } // AddCredential adds the credential to the specified authenticator. // // See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addCredential // // parameters: // // authenticatorID // credential func ( AuthenticatorID, *Credential) *AddCredentialParams { return &AddCredentialParams{ AuthenticatorID: , Credential: , } } // Do executes WebAuthn.addCredential against the provided context. func ( *AddCredentialParams) ( context.Context) ( error) { return cdp.Execute(, CommandAddCredential, , nil) } // GetCredentialParams returns a single credential stored in the given // virtual authenticator that matches the credential ID. type GetCredentialParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` CredentialID string `json:"credentialId"` } // 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 ( AuthenticatorID, string) *GetCredentialParams { return &GetCredentialParams{ AuthenticatorID: , CredentialID: , } } // GetCredentialReturns return values. type GetCredentialReturns struct { Credential *Credential `json:"credential,omitempty"` } // Do executes WebAuthn.getCredential against the provided context. // // returns: // // credential func ( *GetCredentialParams) ( context.Context) ( *Credential, error) { // execute var GetCredentialReturns = cdp.Execute(, CommandGetCredential, , &) if != nil { return nil, } return .Credential, nil } // GetCredentialsParams returns all the credentials stored in the given // virtual authenticator. type GetCredentialsParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` } // 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 ( AuthenticatorID) *GetCredentialsParams { return &GetCredentialsParams{ AuthenticatorID: , } } // GetCredentialsReturns return values. type GetCredentialsReturns struct { Credentials []*Credential `json:"credentials,omitempty"` } // Do executes WebAuthn.getCredentials against the provided context. // // returns: // // credentials func ( *GetCredentialsParams) ( context.Context) ( []*Credential, error) { // execute var GetCredentialsReturns = cdp.Execute(, CommandGetCredentials, , &) if != nil { return nil, } return .Credentials, nil } // RemoveCredentialParams removes a credential from the authenticator. type RemoveCredentialParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` CredentialID string `json:"credentialId"` } // RemoveCredential removes a credential from the authenticator. // // See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeCredential // // parameters: // // authenticatorID // credentialID func ( AuthenticatorID, string) *RemoveCredentialParams { return &RemoveCredentialParams{ AuthenticatorID: , CredentialID: , } } // Do executes WebAuthn.removeCredential against the provided context. func ( *RemoveCredentialParams) ( context.Context) ( error) { return cdp.Execute(, CommandRemoveCredential, , nil) } // ClearCredentialsParams clears all the credentials from the specified // device. type ClearCredentialsParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` } // ClearCredentials clears all the credentials from the specified device. // // See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-clearCredentials // // parameters: // // authenticatorID func ( AuthenticatorID) *ClearCredentialsParams { return &ClearCredentialsParams{ AuthenticatorID: , } } // Do executes WebAuthn.clearCredentials against the provided context. func ( *ClearCredentialsParams) ( context.Context) ( error) { return cdp.Execute(, CommandClearCredentials, , nil) } // SetUserVerifiedParams sets whether User Verification succeeds or fails for // an authenticator. The default is true. type SetUserVerifiedParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` IsUserVerified bool `json:"isUserVerified"` } // 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 func ( AuthenticatorID, bool) *SetUserVerifiedParams { return &SetUserVerifiedParams{ AuthenticatorID: , IsUserVerified: , } } // Do executes WebAuthn.setUserVerified against the provided context. func ( *SetUserVerifiedParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetUserVerified, , nil) } // 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. type SetAutomaticPresenceSimulationParams struct { AuthenticatorID AuthenticatorID `json:"authenticatorId"` Enabled bool `json:"enabled"` } // 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 // // parameters: // // authenticatorID // enabled func ( AuthenticatorID, bool) *SetAutomaticPresenceSimulationParams { return &SetAutomaticPresenceSimulationParams{ AuthenticatorID: , Enabled: , } } // Do executes WebAuthn.setAutomaticPresenceSimulation against the provided context. func ( *SetAutomaticPresenceSimulationParams) ( context.Context) ( error) { return cdp.Execute(, CommandSetAutomaticPresenceSimulation, , nil) } // Command names. 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" )