Repository navigation
fix(security): mask the user name of a URL with no password - #3676
Conversation
redact_text and mask_uri_credentials masked the userinfo of a URL only when it held a password. A token used as the user name, with an empty password, showed in masked text. httpx2 sends such a URL as Basic authentication. The user name is now masked, whatever the scheme: <masked-user> in redact_text and *** in mask_uri_credentials. A parser cannot tell a token from a name such as git, so the rule masks both, as pip does. The module docstring of the sanitizer states the rule and the tests hold it. Plans #2662.
The spec, the design and the module docstring said that both masking functions return a URL with no user name as it was. mask_uri_credentials returns <masked-url> for a text that has an @ and no userinfo (#1109). The texts now name each function, and mask_uri_credentials has a test for both forms. Plans #2662.
|
Test record for this pull request. The body keeps no test results. Fail-to-pass ( Narrow runs after the rebase onto origin/main: 1602 tests pass in Review finding fixed. One review finding was right. The spec, the design and the module docstring said that both functions return a URL with an Full
The 18820 other tests pass. |
🤖 I have created a release *beep* *boop* --- ## [0.63.0](v0.62.7...v0.63.0) (2026-11-05) ### Features * **roadmap:** let a negative search verify check more than one name ([#3678](#3678)) ([5a4364c](5a4364c)) * **telemetry:** count the tool calls of the stage planner by outcome ([#3679](#3679)) ([45da6dd](45da6dd)) ### Bug Fixes * **ci:** count tests and specs as hardening guardrails ([#3684](#3684)) ([1d75506](1d75506)) * **security:** mask the user name of a URL with no password ([#3676](#3676)) ([bc1cd9c](bc1cd9c)) * **service:** count each GitHub request with its HTTP status ([#3686](#3686)) ([b39dcba](b39dcba)) * **telemetry:** Service counters read true across pods and repos ([#3680](#3680)) ([05544ab](05544ab)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
redact_text and mask_uri_credentials left the user name of a URL as written when the URL had no password. A service can take a token as the user name, and httpx2 sends such a URL as Basic authentication. So a token showed in masked text, and the same URL with a password was masked.
The user name is now masked in every scheme: in redact_text and *** in mask_uri_credentials. A parser cannot tell a token from a name such as git, so both are masked, as pip does. The sanitizer docstring states the rule. Cost: the user name of a clone URL is masked too, and the host and the path still show.
Closes #2662
Change:
openspec/changes/archive/2026-11-05-2662-mask-url-user-name-without-password/