hyperlane-plugin-webhook 23.3.0

A production inbound HTTP webhook verification plugin for the Hyperlane framework featuring zero-allocation precomputed-midstate pure-Rust HMAC-SHA256 (Hex, Base64, and Stripe-style timestamped schemes), per-route secret rotation, timestamp skew enforcement, 64-shard bounded TTL replay-nonce caching, and verified WebhookEvent Context injection.
Documentation
<div align="center">

# hyperlane-plugin-webhook

**Inbound HTTP Webhook HMAC-SHA256 Verification & Replay-Defense Plugin**

[![crates.io](https://flat.badgen.net/crates/v/hyperlane-plugin-webhook)](https://crates.io/crates/hyperlane-plugin-webhook)
[![docs.rs](https://img.shields.io/docsrs/hyperlane-plugin-webhook?style=flat-square)](https://docs.rs/hyperlane-plugin-webhook)
[![Rust 2024](https://img.shields.io/badge/edition-2024-orange.svg?style=flat-square)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](../../LICENSE)

[Workspace Overview](../../README.md) · [Plugin Catalog](../README.md) · [API Docs](https://docs.rs/hyperlane-plugin-webhook/latest/)

</div>

---

## Overview

Opt-in request middleware (order `-58`) providing inbound HTTP webhook verification directly on Hyperlane `Request::get_body()`: zero-allocation precomputed-midstate pure-Rust FIPS 180-4 SHA-256 & RFC 4231 HMAC-SHA256 with constant-time signature checks (`Hex`, `Base64`, and Stripe-style `t=...,v1=...` timestamped schemes), per-route secret rotation, timestamp skew window enforcement, a 64-shard bounded TTL replay-nonce cache, and verified `WebhookEvent` metadata injected into `Context` attributes (`ATTR_WEBHOOK_EVENT`).

This crate is a member of the [`hyperlane`](../../README.md) unified Rust 2024 workspace. All plugin crates are opt-in and transparent (`Status::Continue`) when unconfigured.

## Responsibilities & Module Layout

- `struct` / `enum` / `impl` — `HmacSha256Key`, `WebhookSecret`, `WebhookEndpoint`, `WebhookConfig`, `WebhookEvent`, `WebhookVerifier`, `WebhookPlugin`, and `WebhookHook` (`-58`)
- `fn` — Streaming FIPS 180-4 SHA-256, RFC 4231 HMAC-SHA256, constant-time byte equality, stack-allocated Hex/Base64 decoding, and Stripe signature header parsing

## Installation

```sh
cargo add hyperlane-plugin-webhook
```

## Verification

Run crate-scoped formatting, lint, and test gates from the workspace root:

```sh
cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p hyperlane-plugin-webhook --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-webhook --all-features
```

## Documentation & Governance

- Project standards and release workflows live in [`../../.agents/skills/hyperlane/SKILL.md`](../../.agents/skills/hyperlane/SKILL.md).

## License

This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for details.

## Contact

For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).