pub struct WebhookRequest {
pub url: String,
pub method: String,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
pub received_at_ms: u64,
}Expand description
A minimal, ABI-flat snapshot of the inbound HTTP request that a
WebhookPlugin needs in order to verify the signature.
Kept free of framework-specific types (http::Request, hyper::Body)
so that guests compiled to WASM can construct it directly from the
host-function marshalling layer.
Fields§
§url: StringFully-qualified request URL including scheme, host, path and
query. Twilio’s signature covers this exact string, so
middleware MUST preserve the bytes the client sent; do not
re-format via a URL parser before passing to verify.
method: StringHTTP method (POST, GET, …). Some schemes are
method-sensitive (Twilio uses POST vs GET to decide
whether form fields participate in the signature).
headers: Vec<(String, String)>All request headers, in arrival order, keys preserved with their original casing. Matching is performed case-insensitively by the verifier; preserving original case is purely for logs.
body: Vec<u8>Raw body bytes exactly as received. Every in-scope verifier signs this byte stream; deserialising and re-serialising would mutate whitespace / field order and break the HMAC.
received_at_ms: u64Unix-epoch milliseconds at which the host received the
request. Verifiers that enforce a freshness window
(Stripe, Slack) use this as the “now” reference so that
tests can pass a deterministic value instead of wall-clock
time. Default: 0, which verifiers interpret as “use the
plugin’s configured clock”.
Implementations§
Trait Implementations§
Source§impl Clone for WebhookRequest
impl Clone for WebhookRequest
Source§fn clone(&self) -> WebhookRequest
fn clone(&self) -> WebhookRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more