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 moreSource§impl Debug for EnvelopeFormat
impl Debug for EnvelopeFormat
Source§impl Default for EnvelopeFormat
impl Default for EnvelopeFormat
Source§fn default() -> EnvelopeFormat
fn default() -> EnvelopeFormat
Source§impl<'de> Deserialize<'de> for EnvelopeFormat
impl<'de> Deserialize<'de> for EnvelopeFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EnvelopeFormat
impl PartialEq for EnvelopeFormat
Source§fn eq(&self, other: &EnvelopeFormat) -> bool
fn eq(&self, other: &EnvelopeFormat) -> bool
self and other values to be equal, and is used by ==.