diff options
| author | tv <tv@krebsco.de> | 2026-10-26 23:21:01 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-26 23:21:01 +0100 |
| commit | 813f9c57d227a686c6fb08137a2b6b26e9986ef4 (patch) | |
| tree | 774e8fb9f86d608fe78f40981a6abf6f2ccdd032 /src/api | |
| parent | 932efcc8db81eda6f1d91fda74d002c0aecd6629 (diff) | |
show interpolated values in GET /admin/config
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/mod.rs | 16 |
1 files changed, 13 insertions, 3 deletions
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<AppState>) -> Json<JsonValue> { - Json((*state.config).clone()) +/// imported values and secrets are left out. +async fn get_config( + State(state): State<AppState>, + axum::extract::Query(query): axum::extract::Query<ConfigQuery>, +) -> Json<JsonValue> { + Json(state.config.get(query.values).clone()) } // --- shared helpers ---------------------------------------------------------- |
