<div align="center">
# hyperlane-plugin-idempotency
**HTTP `Idempotency-Key` Replay & Concurrent Duplicate Guard Plugin**
[](https://crates.io/crates/hyperlane-plugin-idempotency)
[](https://docs.rs/hyperlane-plugin-idempotency)
[](https://www.rust-lang.org)
[](../../LICENSE)
[Workspace Overview](../../README.md) · [Plugin Catalog](../README.md) · [API Docs](https://docs.rs/hyperlane-plugin-idempotency/latest/)
</div>
---
## Overview
Opt-in request (`-78`) and response (`-60`) middleware enforcing `Idempotency-Key` semantics for HTTP mutation methods (`POST`/`PUT`/`PATCH`/`DELETE`): single-pass `XxHash3_64` `(method, path, body)` request fingerprinting (`422 Unprocessable Entity` on payload mismatch), 64-way sharded bounded `InMemoryIdempotencyStore` plus pluggable async `IdempotencyStore` trait, atomic `InFlight` duplicate locking (`409 Conflict`) with RAII panic/drop cleanup, and zero-copy prebuilt response replay stamped with `Idempotent-Replayed: true`.
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` / `trait` / `impl` — `IdempotencyConfig`, `IdempotencyStore`, `InMemoryIdempotencyStore`, `StoredIdempotentResponse`, `IdempotencyPlugin`, `IdempotencyRequestHook` (`-78`), and `IdempotencyResponseHook` (`-60`)
- `fn` — Zero-allocation `XxHash3_64` request fingerprinting, shard hashing, and wire replay construction
## Installation
```sh
cargo add hyperlane-plugin-idempotency
```
## 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-idempotency --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-idempotency --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).