Expand description
Pluggable auth for Solo’s HTTP transport (v0.8.0 P3).
Two modes (configured via [auth] block in solo.config.toml):
- Bearer — single shared token; one tenant per daemon. Identical
wire-behavior to v0.7.x bearer auth, re-implemented here so the
middleware that emits
AuthenticatedPrincipalcovers both modes. - OIDC — standard OpenID Connect; any provider via discovery URL.
JWKS keys are cached (TTL honors
Cache-Control: max-age=from the discovery doc, falls back to 1 hour). A cache miss on an unknownkidtriggers an immediate refetch (handles IdP key rotation without operator intervention).
MCP uses bearer-only at v0.8.0 — the MCP spec has no story for OIDC. CLI is implicitly trusted (no auth — admin tier).
Wire shape:
- Axum middleware (
auth_middleware) runs ahead of theTenantExtractor. It validates theAuthorizationheader and inserts anAuthenticatedPrincipalinto the request extensions. TenantExtractorthen prefersprincipal.tenant_claim(set in OIDC mode from the configured JWT claim) over theX-Solo-Tenantheader. Bearer-mode principals carry the daemon’s default tenant.
See docs/dev-log/0090-v0.8.0-implementation-plan.md Section 2 P3
for the spec. ADR-0004 (added in P7) documents how auth ties into
per-tenant writer-actor isolation.
Modules§
- bearer
- Bearer-token validation. Forward port of v0.7.x’s
ValidateRequestHeaderLayer::custom(BearerToken::new(token))flow, re-shaped to emit anAuthenticatedPrincipalso downstream layers (audit log, tenant extractor) can treat bearer + OIDC identically. - middleware
- Axum middleware: dispatch to the configured
AuthValidator, insert the resultingAuthenticatedPrincipalinto request extensions, or short-circuit with the appropriate HTTP status. - oidc
- OIDC validation: discovery URL → JWKS → signature + claim checks.
Structs§
- Authenticated
Principal - Result of a successful auth check, attached to the request as an
axum::Extension. TheTenantExtractorinhttp.rsreads this to resolve the request’s target tenant ahead of theX-Solo-Tenantheader. P4 (audit log) readsprincipal.subjectfor the audit-log “who” field.
Enums§
- Auth
Config - Configuration for one auth mode. Stored in
solo_storage::SoloConfigunder the[auth]block. - Auth
Error - Failure modes for both bearer and OIDC validation. The middleware maps these to HTTP status codes (401 for client-supplied-credential failures, 403 for tenant-claim issues, 500 for upstream IdP issues).