Skip to content

Commit 01637e1

Browse files
committed
Obfuscate env vars in /doctor
1 parent 974fb5b commit 01637e1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Improved flaky test #150
6+
- Obfuscate env vars in /doctor.
67

78
## 0.66.1
89

src/eca/features/commands.clj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,17 @@
154154
"\n"
155155
(:auth db)))
156156
(str "Relevant env vars: " (reduce (fn [s [key val]]
157-
(if (or (string/includes? key "KEY")
158-
(string/includes? key "API")
159-
(string/includes? key "URL")
160-
(string/includes? key "BASE"))
157+
(cond
158+
(or (string/includes? key "KEY")
159+
(string/includes? key "TOKEN"))
160+
(str s key "=" (shared/obfuscate val) "\n")
161+
162+
(or (string/includes? key "API")
163+
(string/includes? key "URL")
164+
(string/includes? key "BASE"))
161165
(str s key "=" val "\n")
162-
s))
166+
167+
:else s))
163168
"\n"
164169
(System/getenv)))
165170
""

0 commit comments

Comments
 (0)