Class: WebAuthn::PublicKeyCredential::CreationOptions
- Defined in:
- lib/webauthn/public_key_credential/creation_options.rb
Constant Summary
Constants inherited from Options
Instance Attribute Summary collapse
-
#algs ⇒ Object
Returns the value of attribute algs.
-
#attestation ⇒ Object
Returns the value of attribute attestation.
-
#authenticator_selection ⇒ Object
Returns the value of attribute authenticator_selection.
-
#exclude ⇒ Object
Returns the value of attribute exclude.
-
#rp ⇒ Object
Returns the value of attribute rp.
-
#user ⇒ Object
Returns the value of attribute user.
Attributes inherited from Options
#extensions, #relying_party, #timeout
Instance Method Summary collapse
- #exclude_credentials ⇒ Object
-
#initialize(attestation: nil, authenticator_selection: nil, exclude_credentials: nil, exclude: nil, pub_key_cred_params: nil, algs: nil, rp: {}, user:, **keyword_arguments) ⇒ CreationOptions
constructor
A new instance of CreationOptions.
- #pub_key_cred_params ⇒ Object
Methods inherited from Options
Methods included from JSONSerializer
Constructor Details
#initialize(attestation: nil, authenticator_selection: nil, exclude_credentials: nil, exclude: nil, pub_key_cred_params: nil, algs: nil, rp: {}, user:, **keyword_arguments) ⇒ CreationOptions
Returns a new instance of CreationOptions.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 20 def initialize( attestation: nil, authenticator_selection: nil, exclude_credentials: nil, exclude: nil, pub_key_cred_params: nil, algs: nil, rp: {}, user:, **keyword_arguments ) super(**keyword_arguments) @attestation = attestation @authenticator_selection = authenticator_selection @exclude_credentials = exclude_credentials @exclude = exclude @pub_key_cred_params = pub_key_cred_params @algs = algs @rp = if rp.is_a?(Hash) rp[:name] ||= .name rp[:id] ||= .id RPEntity.new(**rp) else rp end @user = if user.is_a?(Hash) UserEntity.new(**user) else user end end |
Instance Attribute Details
#algs ⇒ Object
Returns the value of attribute algs.
11 12 13 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 11 def algs @algs end |
#attestation ⇒ Object
Returns the value of attribute attestation.
11 12 13 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 11 def attestation @attestation end |
#authenticator_selection ⇒ Object
Returns the value of attribute authenticator_selection.
11 12 13 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 11 def authenticator_selection @authenticator_selection end |
#exclude ⇒ Object
Returns the value of attribute exclude.
11 12 13 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 11 def exclude @exclude end |
#rp ⇒ Object
Returns the value of attribute rp.
11 12 13 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 11 def rp @rp end |
#user ⇒ Object
Returns the value of attribute user.
11 12 13 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 11 def user @user end |
Instance Method Details
#exclude_credentials ⇒ Object
58 59 60 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 58 def exclude_credentials @exclude_credentials || exclude_credentials_from_exclude end |
#pub_key_cred_params ⇒ Object
62 63 64 |
# File 'lib/webauthn/public_key_credential/creation_options.rb', line 62 def pub_key_cred_params @pub_key_cred_params || pub_key_cred_params_from_algs end |