mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:50:43 +00:00
fix: add cdpUrl to sensitive URL config path matching
Browser CDP URLs (browser.cdpUrl, browser.profiles.*.cdpUrl) can embed credentials via query tokens (?token=xxx) or HTTP Basic auth (user:pass@host). Add .cdpUrl suffix to isSensitiveUrlConfigPath() so these paths are correctly redacted in config.get responses. Refs #67656, #53433
This commit is contained in:
@@ -51,6 +51,12 @@ describe("sensitive URL config metadata", () => {
|
||||
expect(isSensitiveUrlConfigPath("gateway.remote.url")).toBe(false);
|
||||
});
|
||||
|
||||
it("recognizes cdpUrl config paths as sensitive (browser CDP URLs can embed credentials)", () => {
|
||||
expect(isSensitiveUrlConfigPath("browser.cdpUrl")).toBe(true);
|
||||
expect(isSensitiveUrlConfigPath("browser.profiles.remote.cdpUrl")).toBe(true);
|
||||
expect(isSensitiveUrlConfigPath("browser.profiles.staging.cdpUrl")).toBe(true);
|
||||
});
|
||||
|
||||
it("uses an explicit url-secret hint tag", () => {
|
||||
expect(SENSITIVE_URL_HINT_TAG).toBe("url-secret");
|
||||
expect(hasSensitiveUrlHintTag({ tags: [SENSITIVE_URL_HINT_TAG] })).toBe(true);
|
||||
|
||||
@@ -25,6 +25,9 @@ export function isSensitiveUrlConfigPath(path: string): boolean {
|
||||
if (path.endsWith(".baseUrl") || path.endsWith(".httpUrl")) {
|
||||
return true;
|
||||
}
|
||||
if (path.endsWith(".cdpUrl")) {
|
||||
return true;
|
||||
}
|
||||
if (path.endsWith(".request.proxy.url")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user