Commit 8c00829
committed
Add showInfo flag to control CLI command logging
This change adds a showInfo boolean field to the CLI struct to prevent
sensitive data exposure in test logs. While RedactBearerToken() helps
with bearer tokens, commands like 'oc set data secret --from-literal=password=secret'
would still expose sensitive data.
Changes:
- Add showInfo field to CLI struct (default: true for backward compatibility)
- Modify start() to conditionally call framework.Logf based on showInfo
- Implement NotShowInfo() and SetShowInfo() methods in util_otp.go
- Initialize showInfo=true in all CLI constructor functions
Usage:
cli.NotShowInfo().Run("set", "data", "secret", ...).Execute()
Fixes: https://issues.redhat.com/browse/OCPERT-2011 parent 1f66b70 commit 8c00829
2 files changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
| 217 | + | |
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
| |||
241 | 245 | | |
242 | 246 | | |
243 | 247 | | |
| 248 | + | |
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
| |||
1020 | 1025 | | |
1021 | 1026 | | |
1022 | 1027 | | |
1023 | | - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1024 | 1032 | | |
1025 | 1033 | | |
1026 | 1034 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
34 | | - | |
| 32 | + | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
0 commit comments