Class: WebAuthn::CredentialRequestOptions
- Inherits:
-
CredentialOptions
- Object
- CredentialOptions
- WebAuthn::CredentialRequestOptions
- Defined in:
- lib/webauthn/credential_request_options.rb
Constant Summary
Constants inherited from CredentialOptions
WebAuthn::CredentialOptions::CHALLENGE_LENGTH
Instance Attribute Summary collapse
-
#allow_credentials ⇒ Object
Returns the value of attribute allow_credentials.
-
#extensions ⇒ Object
Returns the value of attribute extensions.
-
#user_verification ⇒ Object
Returns the value of attribute user_verification.
Instance Method Summary collapse
-
#initialize(allow_credentials: [], extensions: nil, user_verification: nil) ⇒ CredentialRequestOptions
constructor
A new instance of CredentialRequestOptions.
- #to_h ⇒ Object
Methods inherited from CredentialOptions
Constructor Details
#initialize(allow_credentials: [], extensions: nil, user_verification: nil) ⇒ CredentialRequestOptions
Returns a new instance of CredentialRequestOptions.
18 19 20 21 22 23 24 |
# File 'lib/webauthn/credential_request_options.rb', line 18 def initialize(allow_credentials: [], extensions: nil, user_verification: nil) super() @allow_credentials = allow_credentials @extensions = extensions @user_verification = user_verification end |
Instance Attribute Details
#allow_credentials ⇒ Object
Returns the value of attribute allow_credentials.
16 17 18 |
# File 'lib/webauthn/credential_request_options.rb', line 16 def allow_credentials @allow_credentials end |
#extensions ⇒ Object
Returns the value of attribute extensions.
16 17 18 |
# File 'lib/webauthn/credential_request_options.rb', line 16 def extensions @extensions end |
#user_verification ⇒ Object
Returns the value of attribute user_verification.
16 17 18 |
# File 'lib/webauthn/credential_request_options.rb', line 16 def user_verification @user_verification end |
Instance Method Details
#to_h ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/webauthn/credential_request_options.rb', line 26 def to_h = { challenge: challenge, timeout: timeout, allowCredentials: allow_credentials } if extensions [:extensions] = extensions end if user_verification [:userVerification] = user_verification end end |