Skip to main content

router_with_auth

Function router_with_auth 

Source
pub fn router_with_auth(
    state: SoloHttpState,
    bearer_token: Option<String>,
) -> Router
Expand description

Build the router with optional bearer-token auth (v0.7.x legacy shape).

When bearer_token is Some(t), every request except GET /health

  • GET /openapi.json (unauthenticated probes / machine-readable spec) requires Authorization: Bearer t. v0.8.0 P3 routes this through the new AuthValidator::Bearer middleware so an AuthenticatedPrincipal is attached to every authenticated request (the TenantExtractor reads principal.tenant_claim ahead of the X-Solo-Tenant header).