Class: Selenium::DevTools::V131::WebAuthn

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v131/web_authn.rb

Constant Summary collapse

EVENTS =
{
  credential_added: 'credentialAdded',
  credential_deleted: 'credentialDeleted',
  credential_updated: 'credentialUpdated',
  credential_asserted: 'credentialAsserted',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ WebAuthn

Returns a new instance of WebAuthn.



32
33
34
# File 'lib/selenium/devtools/v131/web_authn.rb', line 32

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#add_credential(authenticator_id:, credential:) ⇒ Object



68
69
70
71
72
# File 'lib/selenium/devtools/v131/web_authn.rb', line 68

def add_credential(authenticator_id:, credential:)
  @devtools.send_cmd('WebAuthn.addCredential',
                     authenticatorId: authenticator_id,
                     credential: credential)
end

#add_virtual_authenticator(options:) ⇒ Object



50
51
52
53
# File 'lib/selenium/devtools/v131/web_authn.rb', line 50

def add_virtual_authenticator(options:)
  @devtools.send_cmd('WebAuthn.addVirtualAuthenticator',
                     options: options)
end

#clear_credentials(authenticator_id:) ⇒ Object



91
92
93
94
# File 'lib/selenium/devtools/v131/web_authn.rb', line 91

def clear_credentials(authenticator_id:)
  @devtools.send_cmd('WebAuthn.clearCredentials',
                     authenticatorId: authenticator_id)
end

#disableObject



46
47
48
# File 'lib/selenium/devtools/v131/web_authn.rb', line 46

def disable
  @devtools.send_cmd('WebAuthn.disable')
end

#enable(enable_ui: nil) ⇒ Object



41
42
43
44
# File 'lib/selenium/devtools/v131/web_authn.rb', line 41

def enable(enable_ui: nil)
  @devtools.send_cmd('WebAuthn.enable',
                     enableUI: enable_ui)
end

#get_credential(authenticator_id:, credential_id:) ⇒ Object



74
75
76
77
78
# File 'lib/selenium/devtools/v131/web_authn.rb', line 74

def get_credential(authenticator_id:, credential_id:)
  @devtools.send_cmd('WebAuthn.getCredential',
                     authenticatorId: authenticator_id,
                     credentialId: credential_id)
end

#get_credentials(authenticator_id:) ⇒ Object



80
81
82
83
# File 'lib/selenium/devtools/v131/web_authn.rb', line 80

def get_credentials(authenticator_id:)
  @devtools.send_cmd('WebAuthn.getCredentials',
                     authenticatorId: authenticator_id)
end

#on(event, &block) ⇒ Object



36
37
38
39
# File 'lib/selenium/devtools/v131/web_authn.rb', line 36

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["WebAuthn.#{event}"] << block
end

#remove_credential(authenticator_id:, credential_id:) ⇒ Object



85
86
87
88
89
# File 'lib/selenium/devtools/v131/web_authn.rb', line 85

def remove_credential(authenticator_id:, credential_id:)
  @devtools.send_cmd('WebAuthn.removeCredential',
                     authenticatorId: authenticator_id,
                     credentialId: credential_id)
end

#remove_virtual_authenticator(authenticator_id:) ⇒ Object



63
64
65
66
# File 'lib/selenium/devtools/v131/web_authn.rb', line 63

def remove_virtual_authenticator(authenticator_id:)
  @devtools.send_cmd('WebAuthn.removeVirtualAuthenticator',
                     authenticatorId: authenticator_id)
end

#set_automatic_presence_simulation(authenticator_id:, enabled:) ⇒ Object



102
103
104
105
106
# File 'lib/selenium/devtools/v131/web_authn.rb', line 102

def set_automatic_presence_simulation(authenticator_id:, enabled:)
  @devtools.send_cmd('WebAuthn.setAutomaticPresenceSimulation',
                     authenticatorId: authenticator_id,
                     enabled: enabled)
end

#set_credential_properties(authenticator_id:, credential_id:, backup_eligibility: nil, backup_state: nil) ⇒ Object



108
109
110
111
112
113
114
# File 'lib/selenium/devtools/v131/web_authn.rb', line 108

def set_credential_properties(authenticator_id:, credential_id:, backup_eligibility: nil, backup_state: nil)
  @devtools.send_cmd('WebAuthn.setCredentialProperties',
                     authenticatorId: authenticator_id,
                     credentialId: credential_id,
                     backupEligibility: backup_eligibility,
                     backupState: backup_state)
end

#set_response_override_bits(authenticator_id:, is_bogus_signature: nil, is_bad_uv: nil, is_bad_up: nil) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/selenium/devtools/v131/web_authn.rb', line 55

def set_response_override_bits(authenticator_id:, is_bogus_signature: nil, is_bad_uv: nil, is_bad_up: nil)
  @devtools.send_cmd('WebAuthn.setResponseOverrideBits',
                     authenticatorId: authenticator_id,
                     isBogusSignature: is_bogus_signature,
                     isBadUV: is_bad_uv,
                     isBadUP: is_bad_up)
end

#set_user_verified(authenticator_id:, is_user_verified:) ⇒ Object



96
97
98
99
100
# File 'lib/selenium/devtools/v131/web_authn.rb', line 96

def set_user_verified(authenticator_id:, is_user_verified:)
  @devtools.send_cmd('WebAuthn.setUserVerified',
                     authenticatorId: authenticator_id,
                     isUserVerified: is_user_verified)
end