Skip to main content

hyperlane_plugin_webhook/
lib.rs

1//! hyperlane-plugin-webhook
2//!
3//! Production inbound HTTP webhook verification plugin for Hyperlane with
4//! zero-allocation precomputed-midstate pure-Rust HMAC-SHA256 (`Hex`, `Base64`,
5//! and Stripe-style `t=...,v1=...` schemes), per-route secret rotation,
6//! timestamp skew enforcement, 64-shard bounded TTL replay-nonce caching, and
7//! verified [`WebhookEvent`] `Context` injection.
8
9mod r#const;
10mod r#enum;
11mod r#fn;
12mod r#impl;
13mod r#static;
14mod r#struct;
15mod r#type;
16
17#[cfg(test)]
18#[path = "../tests/mod.rs"]
19mod tests;
20
21pub use {r#const::*, r#enum::*, r#fn::*, r#struct::*};
22
23pub(crate) use {r#static::*, r#type::*};
24
25use std::{
26    array::from_fn,
27    cmp::Reverse,
28    collections::VecDeque,
29    fmt::{self, Debug, Formatter},
30    sync::{
31        Arc, OnceLock, RwLock, RwLockWriteGuard,
32        atomic::{AtomicUsize, Ordering},
33    },
34    time::{Duration, SystemTime, UNIX_EPOCH},
35};
36
37use {
38    hyperlane::{
39        CONTENT_TYPE, Context, HashMapXxHash3_64, HttpStatus, RequestHeaders, Response,
40        ResponseData, ResponseError, ServerHook, Status, Stream, hash_map_xx_hash3_64,
41    },
42    lombok_macros::*,
43};