pub struct WebhookCtx {
pub secret_path: String,
pub signature_header: String,
pub timestamp_header: String,
pub tolerance_seconds: i64,
pub envelope_format: EnvelopeFormat,
}Expand description
Webhook context for a case that involves HMAC signing.
secret_path resolves relative to the case’s fixture_dir and is
loaded lazily by Case::load_secret only when a webhook rule
fires (so non-webhook fixtures need no on-disk secret file).
Fields§
§secret_path: StringPath to the signing secret, relative to the fixture directory.
The file is read verbatim; its trailing newline (if any) is
stripped by Case::load_secret.
signature_header: StringName of the header that carries the signature. For
EnvelopeFormat::Raw this is the digest header; for
EnvelopeFormat::StripeV1 it is the envelope header that
contains both the digest and the timestamp.
timestamp_header: StringName of the header that carries the timestamp the sender hashed.
Ignored when envelope_format is stripe_v1 (the timestamp
then comes from the envelope’s t= field).
tolerance_seconds: i64Maximum acceptable absolute drift (seconds) between
Context::now_unix and the timestamp the sender used.
envelope_format: EnvelopeFormatHow the signature header should be parsed. Defaults to
EnvelopeFormat::Raw so v0.1.0 fixtures continue to validate
without changes.
Trait Implementations§
Source§impl Clone for WebhookCtx
impl Clone for WebhookCtx
Source§fn clone(&self) -> WebhookCtx
fn clone(&self) -> WebhookCtx
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more