pub struct AppState {
pub journal: Arc<dyn Journal>,
pub blob_store: Arc<BlobStore>,
pub data_dir: PathBuf,
pub started_at: Instant,
pub auth: Option<Arc<AuthLayer>>,
pub policy_engine: Option<Arc<PolicyEngine>>,
pub rbac_manager: Option<Arc<RwLock<RbacManager>>>,
pub hook_runner: Option<Arc<HookRunner>>,
pub rate_limiter: Option<Arc<RateLimiter>>,
pub prometheus_handle: PrometheusHandle,
pub manifest_cache: RwLock<HashMap<(String, String), CachedManifest>>,
}Expand description
Shared application state threaded through all axum handlers.
Wrapped in Arc so it can be cheaply cloned into every request.
Fields§
§journal: Arc<dyn Journal>Event journal (session + event persistence).
blob_store: Arc<BlobStore>Content-addressed blob store.
data_dir: PathBufRoot path for filesystem data.
started_at: InstantDaemon startup time for uptime reporting.
auth: Option<Arc<AuthLayer>>Auth layer for JWT-protected routes (None = auth disabled).
policy_engine: Option<Arc<PolicyEngine>>Rule-based policy engine for tool governance (None = no enforcement).
rbac_manager: Option<Arc<RwLock<RbacManager>>>RBAC manager for session-to-role assignments (None = no RBAC). Wrapped in RwLock to support runtime role assignments.
hook_runner: Option<Arc<HookRunner>>Hook runner for pre/post operation hooks (None = no hooks).
rate_limiter: Option<Arc<RateLimiter>>Rate limiter for public endpoints (None = no rate limiting).
prometheus_handle: PrometheusHandlePrometheus metrics handle for rendering the /metrics endpoint.
manifest_cache: RwLock<HashMap<(String, String), CachedManifest>>In-memory manifest cache keyed by (session_id, branch_id). Avoids replaying all journal events on every file/manifest request.