vendor/github.com/go-rod/rod/lib/proto/web_authn.go

429 lines · 14889 bytes

  1// This file is generated by "./lib/proto/generate"
  2
  3package proto
  4
  5/*
  6
  7WebAuthn
  8
  9This domain allows configuring virtual authenticators to test the WebAuthn
 10API.
 11
 12*/
 13
 14// WebAuthnAuthenticatorID ...
 15type WebAuthnAuthenticatorID string
 16
 17// WebAuthnAuthenticatorProtocol ...
 18type WebAuthnAuthenticatorProtocol string
 19
 20const (
 21	// WebAuthnAuthenticatorProtocolU2f enum const.
 22	WebAuthnAuthenticatorProtocolU2f WebAuthnAuthenticatorProtocol = "u2f"
 23
 24	// WebAuthnAuthenticatorProtocolCtap2 enum const.
 25	WebAuthnAuthenticatorProtocolCtap2 WebAuthnAuthenticatorProtocol = "ctap2"
 26)
 27
 28// WebAuthnCtap2Version ...
 29type WebAuthnCtap2Version string
 30
 31const (
 32	// WebAuthnCtap2VersionCtap20 enum const.
 33	WebAuthnCtap2VersionCtap20 WebAuthnCtap2Version = "ctap2_0"
 34
 35	// WebAuthnCtap2VersionCtap21 enum const.
 36	WebAuthnCtap2VersionCtap21 WebAuthnCtap2Version = "ctap2_1"
 37)
 38
 39// WebAuthnAuthenticatorTransport ...
 40type WebAuthnAuthenticatorTransport string
 41
 42const (
 43	// WebAuthnAuthenticatorTransportUsb enum const.
 44	WebAuthnAuthenticatorTransportUsb WebAuthnAuthenticatorTransport = "usb"
 45
 46	// WebAuthnAuthenticatorTransportNfc enum const.
 47	WebAuthnAuthenticatorTransportNfc WebAuthnAuthenticatorTransport = "nfc"
 48
 49	// WebAuthnAuthenticatorTransportBle enum const.
 50	WebAuthnAuthenticatorTransportBle WebAuthnAuthenticatorTransport = "ble"
 51
 52	// WebAuthnAuthenticatorTransportCable enum const.
 53	WebAuthnAuthenticatorTransportCable WebAuthnAuthenticatorTransport = "cable"
 54
 55	// WebAuthnAuthenticatorTransportInternal enum const.
 56	WebAuthnAuthenticatorTransportInternal WebAuthnAuthenticatorTransport = "internal"
 57)
 58
 59// WebAuthnVirtualAuthenticatorOptions ...
 60type WebAuthnVirtualAuthenticatorOptions struct {
 61	// Protocol ...
 62	Protocol WebAuthnAuthenticatorProtocol `json:"protocol"`
 63
 64	// Ctap2Version (optional) Defaults to ctap2_0. Ignored if |protocol| == u2f.
 65	Ctap2Version WebAuthnCtap2Version `json:"ctap2Version,omitempty"`
 66
 67	// Transport ...
 68	Transport WebAuthnAuthenticatorTransport `json:"transport"`
 69
 70	// HasResidentKey (optional) Defaults to false.
 71	HasResidentKey bool `json:"hasResidentKey,omitempty"`
 72
 73	// HasUserVerification (optional) Defaults to false.
 74	HasUserVerification bool `json:"hasUserVerification,omitempty"`
 75
 76	// HasLargeBlob (optional) If set to true, the authenticator will support the largeBlob extension.
 77	// https://w3c.github.io/webauthn#largeBlob
 78	// Defaults to false.
 79	HasLargeBlob bool `json:"hasLargeBlob,omitempty"`
 80
 81	// HasCredBlob (optional) If set to true, the authenticator will support the credBlob extension.
 82	// https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension
 83	// Defaults to false.
 84	HasCredBlob bool `json:"hasCredBlob,omitempty"`
 85
 86	// HasMinPinLength (optional) If set to true, the authenticator will support the minPinLength extension.
 87	// https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension
 88	// Defaults to false.
 89	HasMinPinLength bool `json:"hasMinPinLength,omitempty"`
 90
 91	// HasPrf (optional) If set to true, the authenticator will support the prf extension.
 92	// https://w3c.github.io/webauthn/#prf-extension
 93	// Defaults to false.
 94	HasPrf bool `json:"hasPrf,omitempty"`
 95
 96	// AutomaticPresenceSimulation (optional) If set to true, tests of user presence will succeed immediately.
 97	// Otherwise, they will not be resolved. Defaults to true.
 98	AutomaticPresenceSimulation bool `json:"automaticPresenceSimulation,omitempty"`
 99
100	// IsUserVerified (optional) Sets whether User Verification succeeds or fails for an authenticator.
101	// Defaults to false.
102	IsUserVerified bool `json:"isUserVerified,omitempty"`
103
104	// DefaultBackupEligibility (optional) Credentials created by this authenticator will have the backup
105	// eligibility (BE) flag set to this value. Defaults to false.
106	// https://w3c.github.io/webauthn/#sctn-credential-backup
107	DefaultBackupEligibility bool `json:"defaultBackupEligibility,omitempty"`
108
109	// DefaultBackupState (optional) Credentials created by this authenticator will have the backup state
110	// (BS) flag set to this value. Defaults to false.
111	// https://w3c.github.io/webauthn/#sctn-credential-backup
112	DefaultBackupState bool `json:"defaultBackupState,omitempty"`
113}
114
115// WebAuthnCredential ...
116type WebAuthnCredential struct {
117	// CredentialID ...
118	CredentialID []byte `json:"credentialId"`
119
120	// IsResidentCredential ...
121	IsResidentCredential bool `json:"isResidentCredential"`
122
123	// RpID (optional) Relying Party ID the credential is scoped to. Must be set when adding a
124	// credential.
125	RpID string `json:"rpId,omitempty"`
126
127	// PrivateKey The ECDSA P-256 private key in PKCS#8 format.
128	PrivateKey []byte `json:"privateKey"`
129
130	// UserHandle (optional) An opaque byte sequence with a maximum size of 64 bytes mapping the
131	// credential to a specific user.
132	UserHandle []byte `json:"userHandle,omitempty"`
133
134	// SignCount Signature counter. This is incremented by one for each successful
135	// assertion.
136	// See https://w3c.github.io/webauthn/#signature-counter
137	SignCount int `json:"signCount"`
138
139	// LargeBlob (optional) The large blob associated with the credential.
140	// See https://w3c.github.io/webauthn/#sctn-large-blob-extension
141	LargeBlob []byte `json:"largeBlob,omitempty"`
142
143	// BackupEligibility (optional) Assertions returned by this credential will have the backup eligibility
144	// (BE) flag set to this value. Defaults to the authenticator's
145	// defaultBackupEligibility value.
146	BackupEligibility bool `json:"backupEligibility,omitempty"`
147
148	// BackupState (optional) Assertions returned by this credential will have the backup state (BS)
149	// flag set to this value. Defaults to the authenticator's
150	// defaultBackupState value.
151	BackupState bool `json:"backupState,omitempty"`
152}
153
154// WebAuthnEnable Enable the WebAuthn domain and start intercepting credential storage and
155// retrieval with a virtual authenticator.
156type WebAuthnEnable struct {
157	// EnableUI (optional) Whether to enable the WebAuthn user interface. Enabling the UI is
158	// recommended for debugging and demo purposes, as it is closer to the real
159	// experience. Disabling the UI is recommended for automated testing.
160	// Supported at the embedder's discretion if UI is available.
161	// Defaults to false.
162	EnableUI bool `json:"enableUI,omitempty"`
163}
164
165// ProtoReq name.
166func (m WebAuthnEnable) ProtoReq() string { return "WebAuthn.enable" }
167
168// Call sends the request.
169func (m WebAuthnEnable) Call(c Client) error {
170	return call(m.ProtoReq(), m, nil, c)
171}
172
173// WebAuthnDisable Disable the WebAuthn domain.
174type WebAuthnDisable struct{}
175
176// ProtoReq name.
177func (m WebAuthnDisable) ProtoReq() string { return "WebAuthn.disable" }
178
179// Call sends the request.
180func (m WebAuthnDisable) Call(c Client) error {
181	return call(m.ProtoReq(), m, nil, c)
182}
183
184// WebAuthnAddVirtualAuthenticator Creates and adds a virtual authenticator.
185type WebAuthnAddVirtualAuthenticator struct {
186	// Options ...
187	Options *WebAuthnVirtualAuthenticatorOptions `json:"options"`
188}
189
190// ProtoReq name.
191func (m WebAuthnAddVirtualAuthenticator) ProtoReq() string { return "WebAuthn.addVirtualAuthenticator" }
192
193// Call the request.
194func (m WebAuthnAddVirtualAuthenticator) Call(c Client) (*WebAuthnAddVirtualAuthenticatorResult, error) {
195	var res WebAuthnAddVirtualAuthenticatorResult
196	return &res, call(m.ProtoReq(), m, &res, c)
197}
198
199// WebAuthnAddVirtualAuthenticatorResult ...
200type WebAuthnAddVirtualAuthenticatorResult struct {
201	// AuthenticatorID ...
202	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
203}
204
205// WebAuthnSetResponseOverrideBits Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
206type WebAuthnSetResponseOverrideBits struct {
207	// AuthenticatorID ...
208	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
209
210	// IsBogusSignature (optional) If isBogusSignature is set, overrides the signature in the authenticator response to be zero.
211	// Defaults to false.
212	IsBogusSignature bool `json:"isBogusSignature,omitempty"`
213
214	// IsBadUV (optional) If isBadUV is set, overrides the UV bit in the flags in the authenticator response to
215	// be zero. Defaults to false.
216	IsBadUV bool `json:"isBadUV,omitempty"`
217
218	// IsBadUP (optional) If isBadUP is set, overrides the UP bit in the flags in the authenticator response to
219	// be zero. Defaults to false.
220	IsBadUP bool `json:"isBadUP,omitempty"`
221}
222
223// ProtoReq name.
224func (m WebAuthnSetResponseOverrideBits) ProtoReq() string { return "WebAuthn.setResponseOverrideBits" }
225
226// Call sends the request.
227func (m WebAuthnSetResponseOverrideBits) Call(c Client) error {
228	return call(m.ProtoReq(), m, nil, c)
229}
230
231// WebAuthnRemoveVirtualAuthenticator Removes the given authenticator.
232type WebAuthnRemoveVirtualAuthenticator struct {
233	// AuthenticatorID ...
234	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
235}
236
237// ProtoReq name.
238func (m WebAuthnRemoveVirtualAuthenticator) ProtoReq() string {
239	return "WebAuthn.removeVirtualAuthenticator"
240}
241
242// Call sends the request.
243func (m WebAuthnRemoveVirtualAuthenticator) Call(c Client) error {
244	return call(m.ProtoReq(), m, nil, c)
245}
246
247// WebAuthnAddCredential Adds the credential to the specified authenticator.
248type WebAuthnAddCredential struct {
249	// AuthenticatorID ...
250	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
251
252	// Credential ...
253	Credential *WebAuthnCredential `json:"credential"`
254}
255
256// ProtoReq name.
257func (m WebAuthnAddCredential) ProtoReq() string { return "WebAuthn.addCredential" }
258
259// Call sends the request.
260func (m WebAuthnAddCredential) Call(c Client) error {
261	return call(m.ProtoReq(), m, nil, c)
262}
263
264// WebAuthnGetCredential Returns a single credential stored in the given virtual authenticator that
265// matches the credential ID.
266type WebAuthnGetCredential struct {
267	// AuthenticatorID ...
268	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
269
270	// CredentialID ...
271	CredentialID []byte `json:"credentialId"`
272}
273
274// ProtoReq name.
275func (m WebAuthnGetCredential) ProtoReq() string { return "WebAuthn.getCredential" }
276
277// Call the request.
278func (m WebAuthnGetCredential) Call(c Client) (*WebAuthnGetCredentialResult, error) {
279	var res WebAuthnGetCredentialResult
280	return &res, call(m.ProtoReq(), m, &res, c)
281}
282
283// WebAuthnGetCredentialResult ...
284type WebAuthnGetCredentialResult struct {
285	// Credential ...
286	Credential *WebAuthnCredential `json:"credential"`
287}
288
289// WebAuthnGetCredentials Returns all the credentials stored in the given virtual authenticator.
290type WebAuthnGetCredentials struct {
291	// AuthenticatorID ...
292	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
293}
294
295// ProtoReq name.
296func (m WebAuthnGetCredentials) ProtoReq() string { return "WebAuthn.getCredentials" }
297
298// Call the request.
299func (m WebAuthnGetCredentials) Call(c Client) (*WebAuthnGetCredentialsResult, error) {
300	var res WebAuthnGetCredentialsResult
301	return &res, call(m.ProtoReq(), m, &res, c)
302}
303
304// WebAuthnGetCredentialsResult ...
305type WebAuthnGetCredentialsResult struct {
306	// Credentials ...
307	Credentials []*WebAuthnCredential `json:"credentials"`
308}
309
310// WebAuthnRemoveCredential Removes a credential from the authenticator.
311type WebAuthnRemoveCredential struct {
312	// AuthenticatorID ...
313	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
314
315	// CredentialID ...
316	CredentialID []byte `json:"credentialId"`
317}
318
319// ProtoReq name.
320func (m WebAuthnRemoveCredential) ProtoReq() string { return "WebAuthn.removeCredential" }
321
322// Call sends the request.
323func (m WebAuthnRemoveCredential) Call(c Client) error {
324	return call(m.ProtoReq(), m, nil, c)
325}
326
327// WebAuthnClearCredentials Clears all the credentials from the specified device.
328type WebAuthnClearCredentials struct {
329	// AuthenticatorID ...
330	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
331}
332
333// ProtoReq name.
334func (m WebAuthnClearCredentials) ProtoReq() string { return "WebAuthn.clearCredentials" }
335
336// Call sends the request.
337func (m WebAuthnClearCredentials) Call(c Client) error {
338	return call(m.ProtoReq(), m, nil, c)
339}
340
341// WebAuthnSetUserVerified Sets whether User Verification succeeds or fails for an authenticator.
342// The default is true.
343type WebAuthnSetUserVerified struct {
344	// AuthenticatorID ...
345	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
346
347	// IsUserVerified ...
348	IsUserVerified bool `json:"isUserVerified"`
349}
350
351// ProtoReq name.
352func (m WebAuthnSetUserVerified) ProtoReq() string { return "WebAuthn.setUserVerified" }
353
354// Call sends the request.
355func (m WebAuthnSetUserVerified) Call(c Client) error {
356	return call(m.ProtoReq(), m, nil, c)
357}
358
359// WebAuthnSetAutomaticPresenceSimulation Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator.
360// The default is true.
361type WebAuthnSetAutomaticPresenceSimulation struct {
362	// AuthenticatorID ...
363	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
364
365	// Enabled ...
366	Enabled bool `json:"enabled"`
367}
368
369// ProtoReq name.
370func (m WebAuthnSetAutomaticPresenceSimulation) ProtoReq() string {
371	return "WebAuthn.setAutomaticPresenceSimulation"
372}
373
374// Call sends the request.
375func (m WebAuthnSetAutomaticPresenceSimulation) Call(c Client) error {
376	return call(m.ProtoReq(), m, nil, c)
377}
378
379// WebAuthnSetCredentialProperties Allows setting credential properties.
380// https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties
381type WebAuthnSetCredentialProperties struct {
382	// AuthenticatorID ...
383	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
384
385	// CredentialID ...
386	CredentialID []byte `json:"credentialId"`
387
388	// BackupEligibility (optional) ...
389	BackupEligibility bool `json:"backupEligibility,omitempty"`
390
391	// BackupState (optional) ...
392	BackupState bool `json:"backupState,omitempty"`
393}
394
395// ProtoReq name.
396func (m WebAuthnSetCredentialProperties) ProtoReq() string { return "WebAuthn.setCredentialProperties" }
397
398// Call sends the request.
399func (m WebAuthnSetCredentialProperties) Call(c Client) error {
400	return call(m.ProtoReq(), m, nil, c)
401}
402
403// WebAuthnCredentialAdded Triggered when a credential is added to an authenticator.
404type WebAuthnCredentialAdded struct {
405	// AuthenticatorID ...
406	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
407
408	// Credential ...
409	Credential *WebAuthnCredential `json:"credential"`
410}
411
412// ProtoEvent name.
413func (evt WebAuthnCredentialAdded) ProtoEvent() string {
414	return "WebAuthn.credentialAdded"
415}
416
417// WebAuthnCredentialAsserted Triggered when a credential is used in a webauthn assertion.
418type WebAuthnCredentialAsserted struct {
419	// AuthenticatorID ...
420	AuthenticatorID WebAuthnAuthenticatorID `json:"authenticatorId"`
421
422	// Credential ...
423	Credential *WebAuthnCredential `json:"credential"`
424}
425
426// ProtoEvent name.
427func (evt WebAuthnCredentialAsserted) ProtoEvent() string {
428	return "WebAuthn.credentialAsserted"
429}