fix(qa): preserve cli flag redaction · openclaw/openclaw@af9b026
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1087,6 +1087,7 @@ describe("buildQaRuntimeEnv", () => {
|
1087 | 1087 | "OPENCLAW_QA_CONVEX_SECRET_MAINTAINER=convex-maintainer-secret", |
1088 | 1088 | "OPENCLAW_LIVE_CODEX_API_KEY=codex-live-secret", |
1089 | 1089 | "botToken=12345:AbCdEfGhIjKl", |
| 1090 | +"--botToken=12345:flag-secret", |
1090 | 1091 | '"driverToken":"12345:driver-secr3t"', |
1091 | 1092 | "sutToken='12345:sut-secr3t'", |
1092 | 1093 | "leaseToken=lease-12345", |
@@ -1131,6 +1132,7 @@ describe("buildQaRuntimeEnv", () => {
|
1131 | 1132 | "OPENCLAW_QA_CONVEX_SECRET_MAINTAINER=<redacted>", |
1132 | 1133 | "OPENCLAW_LIVE_CODEX_API_KEY=<redacted>", |
1133 | 1134 | "botToken=<redacted>", |
| 1135 | +"--botToken=<redacted>", |
1134 | 1136 | '"driverToken":"<redacted>"', |
1135 | 1137 | "sutToken=<redacted>", |
1136 | 1138 | "leaseToken=<redacted>", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -54,6 +54,10 @@ function redactSecretValueKey(text: string, key: string) {
|
54 | 54 | const escapedKey = escapeRegExp(key); |
55 | 55 | return text |
56 | 56 | .replace(new RegExp(`([?#&]${escapedKey}=)[^&\\s]+`, "gi"), "$1<redacted>") |
| 57 | +.replace( |
| 58 | +new RegExp(`(^|\\s)(--${escapedKey})(\\s*[=:]\\s*)([^\\s"';,]+|"[^"]*"|'[^']*')`, "gi"), |
| 59 | +`$1$2$3<redacted>`, |
| 60 | +) |
57 | 61 | .replace( |
58 | 62 | new RegExp(`(^|[^\\w?#&-])(${escapedKey})(\\s*[=:]\\s*)([^\\s"';,]+|"[^"]*"|'[^']*')`, "gi"), |
59 | 63 | `$1$2$3<redacted>`, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。