hyperlane-plugin-ip-filter
Zero-Allocation Client IP Extraction & Radix CIDR Allowlist/Denylist Plugin
Workspace Overview · Plugin Catalog · API Docs
Overview
Opt-in request middleware (order -125) resolving the true client IP from Stream::get_peer_addr with anti-spoofing right-to-left hop peeling across trusted proxies (X-Forwarded-For, RFC 7239 Forwarded, and X-Real-IP), injecting ClientIp into Hyperlane Context (ATTR_CLIENT_IP), and enforcing zero-allocation /8 radix-indexed IPv4/IPv6 CIDR allowlists and denylists with IPv4-mapped IPv6 canonicalization (::ffff:a.b.c.d) and prebuilt rejection wire responses.
This crate is a member of the hyperlane unified Rust 2024 workspace. All plugin crates are opt-in and transparent (Status::Continue) when unconfigured.
Responsibilities & Module Layout
struct/enum/impl—IpNet,CidrTable,ClientIp,IpFilterConfig,CompiledIpFilter,IpFilterPlugin, andIpFilterHook(-125)fn— Zero-allocation right-to-left proxy peeling, IPv4-mapped IPv6 canonicalization, and RFC 7239Forwardedparsing
Installation
Verification
Run crate-scoped formatting, lint, and test gates from the workspace root:
Documentation & Governance
- Project standards and release workflows live in
../../.agents/skills/hyperlane/SKILL.md.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For inquiries, please contact the author at root@devhub.vip.