Class: Unmagic::Passkeys::WebAuthn::Authenticator::AttestationVerifiers::None
- Inherits:
-
Object
- Object
- Unmagic::Passkeys::WebAuthn::Authenticator::AttestationVerifiers::None
- Defined in:
- lib/unmagic/passkeys/web_authn/authenticator/attestation_verifiers/none.rb
Overview
Action Pack WebAuthn None Attestation Verifier
Verifies attestation responses with the “none” format, which indicates the authenticator did not provide any attestation statement. This is the default format used by most consumer authenticators.
Implementing Custom Verifiers
To support other attestation formats (e.g., “packed”, “fido-u2f”), implement a class with the same verify! interface and register it:
Unmagic::Passkeys::WebAuthn.register_attestation_verifier("packed", MyPackedVerifier.new)
The verify! method receives the decoded Attestation object and the raw client_data_json bytes. Raise InvalidResponseError if verification fails.
Instance Method Summary collapse
Instance Method Details
#verify!(attestation, client_data_json:) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/unmagic/passkeys/web_authn/authenticator/attestation_verifiers/none.rb', line 18 def verify!(attestation, client_data_json:) if attestation.attestation_statement.present? raise Unmagic::Passkeys::WebAuthn::InvalidResponseError, "Attestation statement must be empty for 'none' format" end end |