//! `GET /admin/config`: the effective configuration, as `--print-config` prints it. use axum::{ Json, extract::{Query, State}, }; use serde_json::Value as JsonValue; use crate::state::AppState; #[derive(Debug, Default, serde::Deserialize)] pub(crate) 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 and secrets are left out. pub(crate) async fn get_config( State(state): State, Query(query): Query, ) -> Json { Json(state.config.get(query.values).clone()) }