Module server

Module server 

Source
Expand description

Axum HTTP/HTTPS server setup.

  • ServerState — shared application state passed through every handler via Axum’s State<Arc<ServerState>> extractor. Holds one SiteBackend per configured site so a single server can fan out to multiple CSM/OpenCHAMI clusters.
  • start_server — binary entry point. Builds the router (see routes::build_router), installs the request-logging middleware, optionally wraps the listener in TLS, and installs a SIGTERM/Ctrl+C handler for graceful shutdown.
  • Submodules:
    • handlers — per-resource Axum handlers; converts HTTP requests into service-layer calls.
    • routes — router registration (one entry per /api/v1 path).
    • auth_middleware — defensive middleware applied to /api/v1/auth/* (per-IP rate limit + body redaction).
    • common — server-only helpers (per-request InfraContext, Kafka audit producer, JWT claim extractors, Vault client).
    • api_doc — utoipa OpenAPI document served at GET /openapi.json + GET /docs.

Modules§

api_doc
OpenAPI specification document for the manta HTTP server.
auth_middleware
Defensive middleware for the /api/v1/auth/* sub-router.
common
Helpers used only by the manta HTTP server (handlers + service layer).
handlers
Top-level Axum handlers module.
routes
Axum router registration: maps every /api/v1/ path to its handler.

Structs§

ServerState
Shared state for all HTTP handlers.
SiteBackend
All per-site connection data the server needs to talk to backend APIs.

Functions§

start_server
Start the HTTP or HTTPS server.