Skip to main content

tenant_rate_limit_middleware

Function tenant_rate_limit_middleware 

Source
pub async fn tenant_rate_limit_middleware(
    __arg0: State<AppState>,
    __arg1: Extension<TenantId>,
    req: Request,
    next: Next,
) -> Response
Expand description

Axum middleware (ADR 0004 §D6): enforce the per-tenant request rate limit. Must run AFTER auth_middleware so the resolved TenantId is already in request extensions. A no-op (never returns 429) when AppState::tenant_rate_limiter is None.