Available on crate feature
rest only.Expand description
What every Adapter does with a request, whatever the platform: verify the signature, parse,
dispatch to the InteractionHandler (or hand a Webhook Event to the EventHandler as
Background Work), and send responses with files through the callback endpoint. Adapters map
the outcomes to their platform’s HTTP response, so every Adapter answers alike.
Enums§
- Event
Outcome - What to answer one Webhook Events request with. Produced by
handle_event. - Files
Error - Why
send_with_filescould not send the response - Interaction
Outcome - What to answer one interaction request with. Produced by
handle_interaction.
Constants§
- DEFAULT_
EVENTS_ PATH - Path Webhook Events are served on unless the Adapter is told otherwise; every other path serves Interactions
- SIGNATURE_
HEADER - Header carrying the request’s Ed25519 signature (hex)
- TIMESTAMP_
HEADER - Header carrying the timestamp the signature covers
Functions§
- handle_
event - Verifies and parses one Webhook Events request and spawns its handling as Background Work,
without any platform. Adapters call
handle_event_with_keyfor the events path; call this directly to test anEventHandlerwith signed payloads. - handle_
event_ with_ key handle_eventwith a parsedPublicKey, as Adapters call it- handle_
interaction - Verifies, parses, and dispatches one interaction request without any platform. Adapters call
handle_interaction_with_key; call this directly to test a handler with signed payloads. - handle_
interaction_ with_ key handle_interactionwith a parsedPublicKey, as Adapters call it- outlined
- Awaits
futurewith itspollin a function of its own, which the optimizer cannot merge into the caller’s. - send_
with_ files - Sends a response carrying files (multipart, which an HTTP reply cannot be) through the
callback endpoint; the Adapter then answers the request with an empty 202.
bodyis the interaction request body: the ids and token are read from it again, so the common path keeps no copy. - verify
- Whether both signature headers are present and sign
bodywithpublic_key