Skip to main content

build_router_with_auth

Function build_router_with_auth 

Source
pub fn build_router_with_auth(state: AppState, auth: AuthConfig) -> Router
Expand description

Build the HTTP router with an explicit AuthConfig.

Tests use this to inject a known auth state without touching process-global env vars. Production code paths use build_router.

The rate limiter is sourced from env (rate_limiter_from_env). Tests that need deterministic rate-limit behavior should use build_router_with_auth_and_rate_limit instead.