harden: debug mode logs only a request's origin and JSON-RPC method (closes #410)
check / check (push) Failing after 2s
e2e / e2e-chrome (push) Failing after 3s
e2e / e2e-firefox (push) Failing after 3s

With debug mode on, debugFetch logged every request's full URL and body,
so an RPC endpoint with an API key in its path or query string printed
that key to the console on every request. It now logs the HTTP method,
the URL's origin and, for a JSON-RPC body, the method name. The balance
refresh and token lookup, which logged the RPC URL at debug level, log
its origin too. The README's DEBUG Mode Policy says what debug mode logs.

Model: opus-5-5
This commit is contained in:
2026-10-04 17:50:47 +00:00
parent d1751beb32
commit b261bafb03
7 changed files with 91 additions and 8 deletions
+1
View File
@@ -44,6 +44,7 @@ jest.mock("../src/shared/log", () => ({
errorf: () => {},
},
debugFetch: jest.fn(),
urlOrigin: () => "",
setRuntimeDebug: () => {},
isDebug: () => false,
}));