Skip to main content

Crate hyperlane_plugin_webhook

Crate hyperlane_plugin_webhook 

Source
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§

HmacSha256Key
Precomputed HMAC-SHA256 key holding ipad and opad midstates for zero-allocation signing/verification.
ReplayNonceCache
High-concurrency 64-way sharded bounded TTL replay-nonce cache.
Sha256State
Streaming FIPS 180-4 SHA-256 hasher with zero heap allocations.
WebhookConfig
Top-level configuration for WebhookVerifier and WebhookPlugin.
WebhookEndpoint
Verification rules for one inbound webhook route or prefix.
WebhookEvent
Verified webhook delivery metadata injected into Hyperlane Context under ATTR_WEBHOOK_EVENT.
WebhookHook
Opt-in request middleware verifying inbound webhook signatures and injecting WebhookEvent.
WebhookPlugin
Process-wide WebhookPlugin singleton holding a WebhookVerifier.
WebhookSecret
Named secret key participating in per-route webhook secret rotation.
WebhookVerifier
Compiled inbound webhook verification engine backing WebhookPlugin.

Enums§

WebhookRejectReason
Specific reason an inbound webhook request was rejected by [WebhookVerifier].
WebhookScheme
Signature header encoding and payload-framing scheme for an inbound [WebhookEndpoint].

Constants§

ATTR_WEBHOOK_EVENT
Context attribute key storing the verified [WebhookEvent] metadata.
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.
decode_base64_32
Decodes a 32-byte RFC 4648 base64 digest (44-char padded or 43-char unpadded) onto the stack.
decode_hex_32
Decodes a 64-character ASCII hex digest directly onto the stack without allocating.
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.
hmac_sha256
Computes the RFC 4231 HMAC-SHA256 authentication tag of data under key with zero heap allocations.
sha256
Computes the FIPS 180-4 SHA-256 digest of data with zero heap allocations.
webhook_now_secs
Returns the current Unix epoch timestamp in whole seconds.