Expand description
Axum router builder and listener.
Constants§
- ENV_
METRICS_ TOKEN - SECURITY (H3): environment variable carrying an optional bearer token
that gates
GET /metrics. When set to a non-empty value the metrics scrape endpoint requiresAuthorization: Bearer <token>matching this value (constant-time compared); when unset or empty the endpoint stays unauthenticated (the historical Prometheus-scrape posture) and a one-shotwarn!is emitted at startup. SeeMetricsAuthandmetrics_auth_gate.
Functions§
- build_
router - Build the axum Router with all routes and middleware applied.
- build_
router_ with_ audit - Build the router with full configuration including the audit sink and the CORS allowlist.
- build_
router_ with_ config - Build the router with explicit auth / tenant config and the rate limiter
disabled. Backwards-compatible shim retained for integration tests that
pre-date the per-token rate limiter; new tests should call
build_router_with_full_config. - build_
router_ with_ full_ config - Build the router with explicitly supplied auth, tenant, and rate-limit config. Used by integration tests so they can drive the gateway without poisoning the process environment.
- build_
router_ with_ kernel_ publish_ tokens - Build the router with every override exposed, including the explicit
KernelPublishTokensallowlist forPOST /kernels. - build_
router_ with_ trusted_ proxies - Build the router with full configuration and an explicit XFCC trusted-proxy allowlist.
- serve
- Bind and serve the router on the given address.