From 8e0647833a3589da77fbda176bddea0796372328 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 4 Feb 2025 22:11:05 +0100 Subject: [PATCH] fix: hide values of WHITELIST_ENVS --- backend/windmill-common/src/worker.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/windmill-common/src/worker.rs b/backend/windmill-common/src/worker.rs index 241679301f..3edee5be30 100644 --- a/backend/windmill-common/src/worker.rs +++ b/backend/windmill-common/src/worker.rs @@ -907,7 +907,7 @@ impl Default for WorkerConfigOpt { } } -#[derive(PartialEq, Debug, Clone)] +#[derive(PartialEq, Clone)] pub struct WorkerConfig { pub worker_tags: Vec, pub priority_tags_sorted: Vec, @@ -919,6 +919,13 @@ pub struct WorkerConfig { pub env_vars: HashMap, } +impl std::fmt::Debug for WorkerConfig { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "WorkerConfig {{ worker_tags: {:?}, priority_tags_sorted: {:?}, dedicated_worker: {:?}, init_bash: {:?}, cache_clear: {:?}, additional_python_paths: {:?}, pip_local_dependencies: {:?}, env_vars: {:?} }}", + self.worker_tags, self.priority_tags_sorted, self.dedicated_worker, self.init_bash, self.cache_clear, self.additional_python_paths, self.pip_local_dependencies, self.env_vars.iter().map(|(k, v)| format!("{}: {}{} ({} chars)", k, &v[..3.min(v.len())], "***", v.len())).collect::>().join(", ")) + } +} + #[derive(PartialEq, Debug, Clone)] pub struct PriorityTags { pub priority: u8,