Class: Selenium::WebDriver::VirtualAuthenticatorOptions

Inherits:
Object
  • Object
show all
Defined in:
rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb

Constant Summary collapse

PROTOCOL =
{ctap2: 'ctap2', u2f: 'ctap1/u2f'}.freeze
TRANSPORT =
{ble: 'ble', usb: 'usb', nfc: 'nfc', internal: 'internal'}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ VirtualAuthenticatorOptions

Returns a new instance of VirtualAuthenticatorOptions.

Raises:

  • (ArgumentError)


37
38
39
40
41
42
43
44
45
46
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 37

def initialize(**opts)
  @protocol = opts.delete(:protocol) { :ctap2 }
  @transport = opts.delete(:transport) { :usb }
  @resident_key = opts.delete(:resident_key) { false }
  @user_verification = opts.delete(:user_verification) { false }
  @user_consenting = opts.delete(:user_consenting) { true }
  @user_verified = opts.delete(:user_verified) { false }

  raise ArgumentError, "Invalid arguments: #{opts.keys}" unless opts.empty?
end

Instance Attribute Details

#protocolObject

Returns the value of attribute protocol.



31
32
33
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 31

def protocol
  @protocol
end

#resident_keyObject Also known as: resident_key?

Returns the value of attribute resident_key.



31
32
33
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 31

def resident_key
  @resident_key
end

#transportObject

Returns the value of attribute transport.



31
32
33
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 31

def transport
  @transport
end

#user_consentingObject Also known as: user_consenting?

Returns the value of attribute user_consenting.



31
32
33
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 31

def user_consenting
  @user_consenting
end

#user_verificationObject Also known as: user_verification?

Returns the value of attribute user_verification.



31
32
33
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 31

def user_verification
  @user_verification
end

#user_verifiedObject Also known as: user_verified?

Returns the value of attribute user_verified.



31
32
33
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 31

def user_verified
  @user_verified
end

Instance Method Details

#as_jsonObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



52
53
54
55
56
57
58
59
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb', line 52

def as_json(*)
  {'protocol' => PROTOCOL[protocol],
   'transport' => TRANSPORT[transport],
   'hasResidentKey' => resident_key?,
   'hasUserVerification' => user_verification?,
   'isUserConsenting' => user_consenting?,
   'isUserVerified' => user_verified?}
end