Skip to main content

trusty_console/proxy/
mod.rs

1//! Reverse-proxy module for trusty-console (#1849 Phase 2).
2//!
3//! Why: Operators want to reach each daemon's UI and API through the console's
4//! single URL (`http://127.0.0.1:7788`) rather than remembering per-daemon
5//! ports.  This module implements the primary `/api/{service}/{*path}` route
6//! (Phase 2) and the deprecated `/proxy/{daemon}/{*path}` alias (backward
7//! compatibility) that both forward requests to the live daemon base URL
8//! resolved from the background health-poll cache.
9//! What: `routes` contains the axum extractor types and the forwarding handlers.
10//! This `mod.rs` re-exports the public surface (`proxy_handler`,
11//! `deprecated_proxy_handler`).
12//! Test: Unit tests for URL construction and normalization live in `routes.rs`.
13
14pub mod routes;
15
16pub use routes::deprecated_proxy_handler;
17pub use routes::proxy_handler;