Expand description
hyperlane-plugin-webhook
Production inbound HTTP webhook verification plugin for Hyperlane with
zero-allocation precomputed-midstate pure-Rust HMAC-SHA256 (Hex, Base64,
and Stripe-style t=...,v1=... schemes), per-route secret rotation,
timestamp skew enforcement, 64-shard bounded TTL replay-nonce caching, and
verified WebhookEvent Context injection.
Structs§
- Hmac
Sha256 Key - Precomputed HMAC-SHA256 key holding ipad and opad midstates for zero-allocation signing/verification.
- Replay
Nonce Cache - High-concurrency 64-way sharded bounded TTL replay-nonce cache.
- Sha256
State - Streaming FIPS 180-4 SHA-256 hasher with zero heap allocations.
- Webhook
Config - Top-level configuration for
WebhookVerifierandWebhookPlugin. - Webhook
Endpoint - Verification rules for one inbound webhook route or prefix.
- Webhook
Event - Verified webhook delivery metadata injected into Hyperlane
ContextunderATTR_WEBHOOK_EVENT. - Webhook
Hook - Opt-in request middleware verifying inbound webhook signatures and injecting
WebhookEvent. - Webhook
Plugin - Process-wide
WebhookPluginsingleton holding aWebhookVerifier. - Webhook
Secret - Named secret key participating in per-route webhook secret rotation.
- Webhook
Verifier - Compiled inbound webhook verification engine backing
WebhookPlugin.
Enums§
- Webhook
Reject Reason - Specific reason an inbound webhook request was rejected by
WebhookVerifier. - Webhook
Scheme - Signature header encoding and payload-framing scheme for an inbound
WebhookEndpoint.
Constants§
- ATTR_
WEBHOOK_ EVENT - Context attribute key storing the verified
WebhookEventmetadata. - DEFAULT_
MAX_ BODY_ BYTES - Default maximum inbound webhook body length in bytes (2 MiB).
- DEFAULT_
REPLAY_ MAX_ ENTRIES - Default maximum replay cache entries across all 64 shards.
- DEFAULT_
REPLAY_ TTL_ SECS - Default replay-nonce TTL in seconds (10 minutes).
- DEFAULT_
STRIPE_ VERSION - Default Stripe signature scheme version key (
"v1"). - DEFAULT_
TOLERANCE_ SECS - Default timestamp skew tolerance window in seconds (5 minutes).
- GITHUB_
SHA256_ PREFIX - Default GitHub signature prefix (
"sha256="). - HEADER_
GITHUB_ DELIVERY - Default GitHub delivery nonce header name.
- HEADER_
GITHUB_ SIGNATURE_ 256 - Default GitHub SHA-256 webhook signature header name.
- HEADER_
SHOPIFY_ HMAC_ SHA256 - Default Shopify HMAC-SHA256 webhook signature header name.
- HEADER_
STRIPE_ SIGNATURE - Default Stripe webhook signature header name.
Functions§
- constant_
time_ eq - Compares two byte slices in constant time with respect to their contents using 8-byte word XORs.
- decode_
base64_ 32 - Decodes a 32-byte RFC 4648 base64 digest (44-char padded or 43-char unpadded) using a branchless LUT.
- decode_
hex_ 32 - Decodes a 64-character ASCII hex digest directly onto the stack using a branchless 256-entry LUT.
- encode_
base64_ 32 - Encodes a 32-byte digest into standard padded RFC 4648 base64 (44 characters).
- encode_
hex_ 32 - Encodes a 32-byte digest into a 64-character lowercase hexadecimal string using a 2-byte pair LUT.
- hmac_
sha256 - Computes the RFC 4231 HMAC-SHA256 authentication tag of
dataunderkeywith zero heap allocations. - sha256
- Computes the FIPS 180-4 SHA-256 digest of
datawith zero heap allocations. - webhook_
now_ secs - Returns the current Unix epoch timestamp in whole seconds.