Skip to main content

Crate hyperlane_plugin_tenant

Crate hyperlane_plugin_tenant 

Source
Expand description

hyperlane-plugin-tenant

Multi-tenant resolution and isolation middleware for Hyperlane supporting header, host-subdomain, and path-prefix tenant extraction, XxHash3_64 registry lookups, pluggable TenantResolver hooks, and prebuilt error wire responses.

Structs§

TenantConfig
Configuration for TenantPlugin.
TenantContext
Resolved tenant context attached to Hyperlane Context under ATTR_TENANT_CONTEXT.
TenantHook
Opt-in request middleware resolving tenant identity and enforcing isolation.
TenantPlugin
Compiled multi-tenant resolution engine backing TenantHook.
TenantRecord
Tenant metadata entry stored in the registry or returned by TenantResolver.

Enums§

TenantResolution
Resolution outcome produced by TenantPlugin::resolve.
TenantSource
Strategy used to extract a raw tenant identifier from an incoming request.
TenantStatus
Lifecycle status of a registered tenant.

Constants§

ATTR_TENANT_CONTEXT
Context attribute key storing resolved [TenantContext].
DEFAULT_MISSING_TENANT_BODY
Default JSON body emitted when no tenant identifier is supplied (400).
DEFAULT_SUSPENDED_TENANT_BODY
Default JSON body emitted when a tenant is suspended (403).
DEFAULT_TENANT_ERROR_CONTENT_TYPE
Default Content-Type for tenant error responses.
DEFAULT_TENANT_HEADER
Default header inspected for tenant identification (x-tenant-id).
DEFAULT_UNKNOWN_TENANT_BODY
Default JSON body emitted when a tenant identifier is unknown (404).
MAX_TENANT_ID_LEN
Maximum accepted byte length of a tenant identifier (64).

Traits§

TenantResolver
Custom tenant directory resolver for dynamic database or cache lookups.

Functions§

is_valid_tenant_id
Validates that a tenant identifier is non-empty, <= MAX_TENANT_ID_LEN, and [a-zA-Z0-9_-].