pub enum EnvelopeFormat {
Raw,
StripeV1,
SlackV0,
GithubHmac,
}Expand description
Selector for how a webhook signature header should be parsed, and the resulting HMAC signing-input shape.
Each variant maps to a real-world signing scheme used by a major
developer-facing API. Adding a new variant means: extending this
enum, extending parse_envelope in src/rules.rs, extending the
signing_input match in WebhookSignatureMismatch::evaluate, and
extending the envelope_format enum in cases.schema.json.
Variants§
Raw
Header value is a raw hex digest, optionally prefixed sha256=.
Timestamp comes from a separate timestamp_header.
Signing input: "{ts}.{body}".
StripeV1
Stripe-style envelope: t=<unix_ts>,v1=<sig>,v0=<sig>,....
Timestamp comes from the envelope’s t= field; timestamp_header
is ignored.
Signing input: "{ts}.{body}".
SlackV0
Slack v0 envelope: X-Slack-Signature: v0=<hex>. Timestamp
comes from a separate X-Slack-Request-Timestamp header.
Signing input: "v0:{ts}:{body}".
GithubHmac
GitHub-style HMAC: X-Hub-Signature-256: sha256=<hex>. There
is no timestamp claim; webhook_timestamp_stale cannot fire.
Signing input: {body} (raw body, no prefix).
Trait Implementations§
Source§impl Clone for EnvelopeFormat
impl Clone for EnvelopeFormat
Source§fn clone(&self) -> EnvelopeFormat
fn clone(&self) -> EnvelopeFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more