diff options
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 ---------------------------------------------------------- |
