hyperlane-plugin-tenant 23.3.2

A zero-allocation multi-tenant resolution and isolation plugin for the Hyperlane framework supporting X-Tenant-Id header, Host subdomain, and path-prefix extraction, XxHash3_64 tenant registry, pluggable TenantResolver, and prebuilt 400/403/404 wire responses.
Documentation
<div align="center">

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

# hyperlane-plugin-tenant

**Zero-Allocation Multi-Tenant Resolution & Isolation Plugin**

[![Crates.io Version](https://flat.badgen.net/crates/v/hyperlane-plugin-tenant)](https://crates.io/crates/hyperlane-plugin-tenant)
[![Docs.rs](https://img.shields.io/docsrs/hyperlane-plugin-tenant?style=flat-square)](https://docs.rs/hyperlane-plugin-tenant)
[![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-tenant/latest/)

</div>

---

## Overview

`hyperlane-plugin-tenant` resolves and validates tenant identity across headers, subdomains, and path prefixes for multi-tenant [`hyperlane`](../../README.md) services (hook order `-98`). It is opt-in and transparent (`Status::Continue`) when unconfigured.

## Installation

```sh
cargo add hyperlane-plugin-tenant
```

## Usage

```rust
use hyperlane_plugin_tenant::{TenantConfig, TenantPlugin};

fn setup_tenant() {
    TenantPlugin::init(TenantConfig::default());
}
```

## Verification

```sh
cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p hyperlane-plugin-tenant --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-tenant --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).