diff --git a/src/config.rs b/src/config.rs index 1d80230..cb21c0f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -72,6 +72,7 @@ pub fn load_config() -> Result { Ok(config) } +#[derive(Debug)] /// Represents a fully parsed config, from a variety of sources. pub struct Config { pub cache_type: CacheType, @@ -199,10 +200,16 @@ struct YamlServerSettings { external_ip: Option, } -// this intentionally does not implement display or debug +// this intentionally does not implement display #[derive(Deserialize, Serialize, Clone)] pub struct ClientSecret(String); +impl std::fmt::Debug for ClientSecret { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "[client secret]") + } +} + #[derive(Deserialize, Default)] struct YamlExtendedOptions { memory_quota: Option, @@ -213,7 +220,7 @@ struct YamlExtendedOptions { cache_path: Option, } -#[derive(Deserialize, Copy, Clone)] +#[derive(Deserialize, Copy, Clone, Debug)] #[serde(rename_all = "snake_case")] pub enum CacheType { OnDisk, diff --git a/src/main.rs b/src/main.rs index 683ac80..02e3320 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,6 +86,8 @@ async fn main() -> Result<(), Box> { return Err(e); } + debug!("{:?}", &config); + let client_secret = config.client_secret.clone(); let client_secret_1 = config.client_secret.clone();