Class: WebAuthn::PublicKeyCredential::Options
- Inherits:
-
Object
- Object
- WebAuthn::PublicKeyCredential::Options
- Defined in:
- lib/webauthn/public_key_credential/options.rb
Direct Known Subclasses
Constant Summary collapse
- CHALLENGE_LENGTH =
32
Instance Attribute Summary collapse
-
#extensions ⇒ Object
readonly
Returns the value of attribute extensions.
-
#relying_party ⇒ Object
readonly
Returns the value of attribute relying_party.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#as_json ⇒ Object
Argument wildcard for Ruby on Rails controller automatic object JSON serialization.
- #challenge ⇒ Object
-
#initialize(timeout: nil, extensions: nil, relying_party: WebAuthn.configuration.relying_party) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(timeout: nil, extensions: nil, relying_party: WebAuthn.configuration.relying_party) ⇒ Options
Returns a new instance of Options.
13 14 15 16 17 |
# File 'lib/webauthn/public_key_credential/options.rb', line 13 def initialize(timeout: nil, extensions: nil, relying_party: WebAuthn.configuration.) @relying_party = @timeout = timeout || default_timeout @extensions = default_extensions.merge(extensions || {}) end |
Instance Attribute Details
#extensions ⇒ Object (readonly)
Returns the value of attribute extensions.
11 12 13 |
# File 'lib/webauthn/public_key_credential/options.rb', line 11 def extensions @extensions end |
#relying_party ⇒ Object (readonly)
Returns the value of attribute relying_party.
11 12 13 |
# File 'lib/webauthn/public_key_credential/options.rb', line 11 def @relying_party end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
11 12 13 |
# File 'lib/webauthn/public_key_credential/options.rb', line 11 def timeout @timeout end |
Instance Method Details
#as_json ⇒ Object
Argument wildcard for Ruby on Rails controller automatic object JSON serialization
24 25 26 |
# File 'lib/webauthn/public_key_credential/options.rb', line 24 def as_json(*) to_hash.to_camelback_keys end |
#challenge ⇒ Object
19 20 21 |
# File 'lib/webauthn/public_key_credential/options.rb', line 19 def challenge encoder.encode(raw_challenge) end |