Webhook verification using the provider's ES256 public key and JWT claims.
verify/2 requires the target URL as :audience and the Fatture in Cloud app ID
as :application_id. :event_id and :subject optionally bind claims to an
event; verify_event/3 checks both automatically for binary/structured events.
:public_key accepts a trusted PEM for key rotation. :clock_skew defaults to
30 seconds. The published key is pinned; update it if the provider rotates it.
Authenticate verification GETs before echoing verification_response/1 with
HTTP 200. Deduplicate POST notifications by their event ID in your application;
provider delivery is at least once and can be out of order. JWT verification
authenticates provider claims; it is not a digest of the HTTP request body.
Summary
Functions
Body to return with HTTP 200 for an authenticated verification challenge.
Verifies signature, algorithm, issuer, audience, app ID and token times.
Verifies an event and checks JWT jti/sub against the event ID/subject.
Functions
Body to return with HTTP 200 for an authenticated verification challenge.
Verifies signature, algorithm, issuer, audience, app ID and token times.
@spec verify_event(map() | list(), term(), keyword()) :: {:ok, map()} | {:error, :invalid_claims | :invalid_signature | :invalid_event}
Verifies an event and checks JWT jti/sub against the event ID/subject.