Problem
Two tools echo the upstream proxy URL back verbatim:
// src/tools/upstream.ts:25
message: `Global upstream set to ${proxy_url}`,
// src/tools/upstream.ts:71
message: `Upstream for '${hostname}' set to ${proxy_url}`,
Upstream URLs routinely carry credentials — both tool descriptions advertise
socks5://user:pass@host:port. MCP tool results are persisted in the client
transcript, so each call writes the upstream password into the conversation log
a second time, on top of the call arguments.
proxy_mobile_setup also accepts upstream_proxy_url but reports only
upstream_set: <boolean>, so it is already fine.
Acceptance criteria
- Both success messages redact the password while keeping scheme, username,
host, port and path visible:
Global upstream set to http://groups-RESIDENTIAL,country-US:***@proxy.apify.com:8000
- The username is deliberately preserved. For several providers the username
field is configuration rather than a secret — with Apify Proxy it encodes
proxy group, country and sticky-session id — and it is what makes the
confirmation message worth printing. Only the password is replaced.
- A URL with no password is unchanged.
- A URL that fails to parse is reported as
<unparseable url> or similar, never
echoed verbatim as a fallback.
- Redaction lives in a pure exported function in
src/utils.ts, covered in
test/unit/utils.test.ts, with cases for: user+password, username only,
no userinfo, empty password (user:@host), percent-encoded credentials,
a socks5:// URL, a pac+http:// URL, and an unparseable string.
- Add no runtime dependency.
new URL() handles every scheme in use here,
including socks5://, pac+http://, and usernames containing commas.
Verification
npm run build && npm run test:unit
Problem
Two tools echo the upstream proxy URL back verbatim:
Upstream URLs routinely carry credentials — both tool descriptions advertise
socks5://user:pass@host:port. MCP tool results are persisted in the clienttranscript, so each call writes the upstream password into the conversation log
a second time, on top of the call arguments.
proxy_mobile_setupalso acceptsupstream_proxy_urlbut reports onlyupstream_set: <boolean>, so it is already fine.Acceptance criteria
host, port and path visible:
Global upstream set to http://groups-RESIDENTIAL,country-US:***@proxy.apify.com:8000field is configuration rather than a secret — with Apify Proxy it encodes
proxy group, country and sticky-session id — and it is what makes the
confirmation message worth printing. Only the password is replaced.
<unparseable url>or similar, neverechoed verbatim as a fallback.
src/utils.ts, covered intest/unit/utils.test.ts, with cases for: user+password, username only,no userinfo, empty password (
user:@host), percent-encoded credentials,a
socks5://URL, apac+http://URL, and an unparseable string.new URL()handles every scheme in use here,including
socks5://,pac+http://, and usernames containing commas.Verification
npm run build && npm run test:unit