hyperlane-plugin-ip-filter 23.3.2

A zero-allocation IP allowlist/denylist and anti-spoofing client IP extraction plugin for the Hyperlane framework with /8 radix-indexed CIDR lookup, IPv4-mapped IPv6 canonicalization, RFC 7239 Forwarded/X-Forwarded-For right-to-left proxy peeling, and prebuilt 403 wire responses.
Documentation
<div align="center">

<img src="https://devhub.vip/pages/docs/img/hyperlane.png" alt="hyperlane-plugin-ip-filter logo" height="120">

# hyperlane-plugin-ip-filter

**Anti-Spoofing Client IP Extraction & Radix CIDR Allowlist/Denylist Plugin**

[![Crates.io Version](https://flat.badgen.net/crates/v/hyperlane-plugin-ip-filter)](https://crates.io/crates/hyperlane-plugin-ip-filter)
[![Docs.rs](https://img.shields.io/docsrs/hyperlane-plugin-ip-filter?style=flat-square)](https://docs.rs/hyperlane-plugin-ip-filter)
[![CI Status](https://img.shields.io/github/actions/workflow/status/hyperlane-dev/hyperlane/rust.yml?branch=master&style=flat-square&label=CI)](https://github.com/hyperlane-dev/hyperlane/actions/workflows/rust.yml)
[![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-ip-filter/latest/)

</div>

---

## Overview

`hyperlane-plugin-ip-filter` extracts verified client IPs behind trusted proxies and enforces zero-allocation IPv4/IPv6 CIDR allowlists and denylists for [`hyperlane`](../../README.md) services (hook order `-125`). It is opt-in and transparent (`Status::Continue`) when unconfigured.

## Installation

```sh
cargo add hyperlane-plugin-ip-filter
```

## Usage

```rust
use hyperlane_plugin_ip_filter::{IpFilterConfig, IpFilterPlugin};

fn setup_ip_filter() {
    IpFilterPlugin::init(IpFilterConfig::default());
}
```

## Verification

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

## 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).