ito_backend/lib.rs
1//! Multi-tenant backend state API for Ito projects.
2//!
3//! `ito-backend` is a **Layer 3 adapter** that exposes Ito project state
4//! (changes, tasks, modules) via a RESTful HTTP API. It delegates all business
5//! logic to [`ito_core`] and communicates exclusively in JSON.
6//!
7//! All project-scoped routes are nested under `/api/v1/projects/{org}/{repo}/`.
8//! Authentication uses admin tokens and HMAC-SHA256 derived per-project tokens.
9//! An organization/repository allowlist is enforced before token validation.
10//!
11//! The public surface is intentionally minimal: call [`serve`] with a
12//! [`BackendServerConfig`] to
13//! start the server.
14
15#![warn(missing_docs)]
16
17mod api;
18mod auth;
19mod error;
20mod server;
21mod state;
22
23pub use server::serve;
24
25/// Re-export the configuration type callers need to start the server.
26pub use ito_config::types::BackendServerConfig;
27
28/// Re-export auth utilities for token derivation.
29pub use auth::derive_project_token;