Class: WebAuthn::PublicKeyCredential::RequestOptions

Inherits:
Options
  • Object
show all
Defined in:
lib/webauthn/public_key_credential/request_options.rb

Constant Summary

Constants inherited from Options

Options::CHALLENGE_LENGTH

Instance Attribute Summary collapse

Attributes inherited from Options

#extensions, #relying_party, #timeout

Instance Method Summary collapse

Methods inherited from Options

#challenge

Methods included from JSONSerializer

#as_json

Constructor Details

#initialize(rp_id: nil, allow_credentials: nil, allow: nil, user_verification: nil, **keyword_arguments) ⇒ RequestOptions

Returns a new instance of RequestOptions.



10
11
12
13
14
15
16
17
# File 'lib/webauthn/public_key_credential/request_options.rb', line 10

def initialize(rp_id: nil, allow_credentials: nil, allow: nil, user_verification: nil, **keyword_arguments)
  super(**keyword_arguments)

  @rp_id = rp_id || relying_party.id
  @allow_credentials = allow_credentials
  @allow = allow
  @user_verification = user_verification
end

Instance Attribute Details

#allowObject

Returns the value of attribute allow.



8
9
10
# File 'lib/webauthn/public_key_credential/request_options.rb', line 8

def allow
  @allow
end

#rp_idObject

Returns the value of attribute rp_id.



8
9
10
# File 'lib/webauthn/public_key_credential/request_options.rb', line 8

def rp_id
  @rp_id
end

#user_verificationObject

Returns the value of attribute user_verification.



8
9
10
# File 'lib/webauthn/public_key_credential/request_options.rb', line 8

def user_verification
  @user_verification
end

Instance Method Details

#allow_credentialsObject



19
20
21
# File 'lib/webauthn/public_key_credential/request_options.rb', line 19

def allow_credentials
  @allow_credentials || allow_credentials_from_allow || []
end