From 813f9c57d227a686c6fb08137a2b6b26e9986ef4 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 23:21:01 +0100 Subject: show interpolated values in GET /admin/config --- src/api/mod.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/api/mod.rs') diff --git a/src/api/mod.rs b/src/api/mod.rs index 20237e1..45eaec4 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -136,10 +136,20 @@ async fn openapi_spec() -> impl IntoResponse { ) } +#[derive(Debug, Default, serde::Deserialize)] +struct ConfigQuery { + /// Text with placeholders as it ends up, or as written. + #[serde(default)] + values: crate::config::Values, +} + /// `GET /admin/config`: the effective configuration with each value's source; -/// imported values are left out. -async fn get_config(State(state): State) -> Json { - Json((*state.config).clone()) +/// imported values and secrets are left out. +async fn get_config( + State(state): State, + axum::extract::Query(query): axum::extract::Query, +) -> Json { + Json(state.config.get(query.values).clone()) } // --- shared helpers ---------------------------------------------------------- -- cgit v1.3.1