Skip to content

Errors and Debug output no longer print the session's credential URLs (0.6.2) - #14

Merged
jssng-pinetree merged 2 commits into
mainfrom
bug1/redact-cdp-url
Nov 3, 2026
Merged

jssng-pinetree merged 2 commits into
mainfrom
bug1/redact-cdp-url

Conversation

@solari-ci-status

@solari-ci-status solari-ci-status Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What

SDK audit item (2026-11-03): connect errors print the full CDP URL, which is a credential (it carries the session in its path).

  • connect() / connect_endpoint() failures now say failed to connect to wss://host/…, and the underlying library's text has the URL removed (chromiumoxide prints the URL it was given).
  • Failed replay downloads (get_presigned*) no longer print the signed URL either.
  • Session's Debug hides the session id and the endpoint paths ({:?} in a log line used to print them).
  • The session id in /sessions/<id> (the credential inside the ws/cdp URLs) is cut to its first 8 characters in REST error messages (redact_path; API errors and transport failures; the reqwest text is scrubbed of the URL).
  • New helpers redact_url (scheme://host[:port]/…, <url> for anything unparseable) and scrub_url_from in http.rs.

Tests

tests/redact_url.rs (connect error to a refused port with a secret path and token; Debug of a Session) and three unit tests in http.rs (redaction table, scrubbing of a library message, a failed presigned GET). Mutation-checked: removing the redaction in connect.rs turns a_failed_connect_does_not_print_the_cdp_endpoint red. cargo test --all-features: all pass.

Release

0.6.1 to 0.6.2 and a CHANGELOG entry. Publish to crates.io after merge (James's go).

🤖 Generated with Claude Code

https://claude.ai/code/session_015oB9MJ9RWqvreBqgtBJfWN

… (0.6.2)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oB9MJ9RWqvreBqgtBJfWN
@solari-ci-status

Copy link
Copy Markdown
Contributor Author

ARCHI-SIGNOFF browser cf39478

Read the diff and ran it. redact_url keeps scheme://host[:port]/… only (userinfo, path and query dropped, anything unparseable becomes <url>); scrub_url_from replaces the exact secret URL wherever the library printed it and then redacts any other URL-looking token, replacing a token that does not parse with <url> (over-redaction, which is the safe direction). It is applied to the CDP connect error, both presigned GET errors (text and bytes), and Session's Debug now hides the id and the endpoint paths.

cargo test --all-features: 56 unit + 3 + 3 + 2 (new redact_url integration tests) + 4 pass. Mutants, each caught: printing the raw endpoint in the connect error, showing ws_endpoint in Debug, showing the session id in Debug. CI green; version 0.6.2.

Not covered by this PR, for a follow-up: REST error messages still contain the request path, for example /sessions/<id>/…, and the session id is the credential in the ws/cdp URLs; a caller who logs those errors writes the id to its logs. The caller supplied the id, so this is a smaller exposure than the URL the library invented, but it is the same class.

Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01MiLFVaN9mLhqJcQZhRAbzU

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015oB9MJ9RWqvreBqgtBJfWN
@solari-ci-status

Copy link
Copy Markdown
Contributor Author

ARCHI-SIGNOFF browser a88855a (diff against cf3947819e40)

redact_path cuts the id in /sessions/<id> to its first 8 characters (keeping the rest of the path and any query), and is used in api_error, the retry messages and the "exhausted N attempts" message; transport failure text is scrubbed of the request URL. Tests: 59 unit + 3 + 3 + 2 + 4 pass. Mutants, each caught: api_error printing the raw path, and the transport-failure message printing the raw path and library text. CI green. My earlier notes stand; the REST-path follow-up I raised is now covered here.

Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01MiLFVaN9mLhqJcQZhRAbzU

@jssng-pinetree
jssng-pinetree merged commit 0c95dd3 into main Nov 3, 2026
1 check passed
@jssng-pinetree
jssng-pinetree deleted the bug1/redact-cdp-url branch November 3, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant