class WebAuthn::PublicKeyCredential::Options
def as_public_key_descriptors(ids)
def as_public_key_descriptors(ids) Array(ids).map { |id| { type: TYPE_PUBLIC_KEY, id: id } } end
def attributes
def attributes [:challenge, :timeout, :extensions] end
def challenge
def challenge encoder.encode(raw_challenge) end
def default_extensions
def default_extensions {} end
def default_timeout
def default_timeout relying_party.credential_options_timeout end
def encoder
def encoder relying_party.encoder end
def initialize(timeout: nil, extensions: nil, relying_party: WebAuthn.configuration.relying_party)
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
def raw_challenge
def raw_challenge @raw_challenge ||= SecureRandom.random_bytes(CHALLENGE_LENGTH) end