Class: Axn::Webhooks::Inbound::ChallengeRequired
- Inherits:
-
Object
- Object
- Axn::Webhooks::Inbound::ChallengeRequired
- Includes:
- Axn, VendorFacet
- Defined in:
- lib/axn/webhooks/inbound/challenge_required.rb
Overview
The challenge-required precondition, as an Axn — for the same reason the verifier, the
parse: step and the GET challenge resolver each have one: it is request-dependent code the
gem does not own, reading adversarial input. It runs FIRST on the POST path, ahead of every
other boundary, so a raise here would otherwise leave Endpoint#call as an unhandled Rack
exception rather than a reported one and a controlled response.
A crash settles not-ok, which Endpoint reads as "can't tell" and answers by verifying normally — the behaviour from before the precondition existed. Safe by construction: Verify still decides, so a broken predicate can neither dispatch an unauthenticated request nor drop an authenticated one. It costs the telemetry saving until it's fixed, and says so once via on_exception rather than failing silently.
Instance Method Summary collapse
Methods included from VendorFacet
Instance Method Details
#call ⇒ Object
29 30 31 |
# File 'lib/axn/webhooks/inbound/challenge_required.rb', line 29 def call expose required: !!predicate.call(request) end |