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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::*;

/// Custom tenant directory resolver for dynamic database or cache lookups.
pub trait TenantResolver: Send + Sync + 'static {
    /// Resolves `tenant_id` into a [`TenantRecord`], or `None` when unknown.
    ///
    /// # Arguments
    ///
    /// - `&str` - Syntactically validated tenant identifier.
    ///
    /// # Returns
    ///
    /// - `Option<TenantRecord>` - Resolved tenant record, if found.
    fn resolve(&self, tenant_id: &str) -> Option<TenantRecord>;
}