Class: WebAuthn::PublicKeyCredential::Options

Inherits:
Object
  • Object
show all
Includes:
JSONSerializer
Defined in:
lib/webauthn/public_key_credential/options.rb

Direct Known Subclasses

CreationOptions, RequestOptions

Constant Summary collapse

CHALLENGE_LENGTH =
32

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from JSONSerializer

#as_json

Constructor Details

#initialize(timeout: nil, extensions: nil, relying_party: WebAuthn.configuration.relying_party) ⇒ Options

Returns a new instance of Options.



14
15
16
17
18
# File 'lib/webauthn/public_key_credential/options.rb', line 14

def initialize(timeout: nil, extensions: nil, relying_party: WebAuthn.configuration.relying_party)
  @relying_party = relying_party
  @timeout = timeout || default_timeout
  @extensions = default_extensions.merge(extensions || {})
end

Instance Attribute Details

#extensionsObject (readonly)

Returns the value of attribute extensions.



12
13
14
# File 'lib/webauthn/public_key_credential/options.rb', line 12

def extensions
  @extensions
end

#relying_partyObject (readonly)

Returns the value of attribute relying_party.



12
13
14
# File 'lib/webauthn/public_key_credential/options.rb', line 12

def relying_party
  @relying_party
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



12
13
14
# File 'lib/webauthn/public_key_credential/options.rb', line 12

def timeout
  @timeout
end

Instance Method Details

#challengeObject



20
21
22
# File 'lib/webauthn/public_key_credential/options.rb', line 20

def challenge
  encoder.encode(raw_challenge)
end