fslite_server/state.rs
1use std::sync::Arc;
2
3use fslite_core::{FileSystem, WorkspaceId};
4
5use crate::admin::WorkspaceAdmin;
6use crate::auth::AuthProvider;
7
8/// Shared, cloneable application state handed to every route.
9#[derive(Clone)]
10pub struct AppState {
11 /// The backend-agnostic filesystem every data route is driven through.
12 pub fs: Arc<dyn FileSystem>,
13 /// Resolves inbound credentials to a workspace and capability set.
14 pub auth: Arc<dyn AuthProvider>,
15 /// Workspace lifecycle operations (create/delete), backend-specific.
16 pub admin: Arc<dyn WorkspaceAdmin>,
17 /// The workspace `/readyz` probes with a cheap `exists(root)` call.
18 pub health_workspace: WorkspaceId,
19}