Module common

Module common 

Source
Expand description

Helpers used only by the manta HTTP server (handlers + service layer).

  • app_context — per-request app_context::InfraContext bundle (backend dispatcher + base URLs + TLS material + optional Vault/k8s URLs). Built by super::ServerState::infra_context on every request.
  • audit — structured auth_attempt event builder that publishes to Kafka via kafka::Kafka. Fire-and-forget; failures are logged but never propagated.
  • jwt_ops — extract name, preferred_username, and realm_access.roles from a bearer JWT without verifying the signature (see the module-level security caveat).
  • kafka — lazily-initialised Kafka producer used by audit.
  • vault — HTTP client for the HashiCorp Vault used by handlers that need backend secrets (Gitea token, k8s creds).

Modules§

app_context
Server-side runtime infrastructure context.
audit
Audit trail helpers: build and send structured JSON messages to Kafka.
jwt_ops
JWT decode helpers (relocated to manta_shared::common::jwt_ops).
kafka
Lazily-initialised Kafka producer used by the audit subsystem.
vault
Vault client used by handlers that need backend-specific secrets (Gitea token for create_session, Kubernetes credentials for the console and log-streaming handlers).