fix(auth): strip userinfo from the URLs that whoami prints #612

Merged
hexajon merged 1 commit from issue-608-whoami-url-userinfo into main 2026-09-23 16:38:54 +00:00
Owner

Summary

auth whoami printed the resolved forge URL as it was, so a hand-set URL with user:secret@host put the secret into the terminal or a transcript. The new config.RedactUserinfo removes the userinfo. whoami uses it for the URL line (the text output and the JSON field) and for both resolution-chain listings.

RedactUserinfo works on the raw text, so it also cleans a URL that net/url cannot parse. A whoami test runs the real command with a secret in MADTEA_URL and fails with the redaction removed.

Closes #608

Closes #608

## Summary `auth whoami` printed the resolved forge URL as it was, so a hand-set URL with `user:secret@host` put the secret into the terminal or a transcript. The new `config.RedactUserinfo` removes the userinfo. whoami uses it for the URL line (the text output and the JSON field) and for both resolution-chain listings. `RedactUserinfo` works on the raw text, so it also cleans a URL that `net/url` cannot parse. A whoami test runs the real command with a secret in `MADTEA_URL` and fails with the redaction removed. Closes #608 Closes #608
fix(auth): strip userinfo from the URLs that whoami prints
Some checks failed
ci / mcp-conformance (pull_request) Successful in 2m9s
drift / govulncheck (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 59s
drift / forgejo-smoke (pull_request) Has been skipped
ci / mcp-conformance (push) Successful in 1s
drift / govulncheck (push) Has been skipped
drift / forgejo-smoke (push) Has been skipped
drift / surface-diff (push) Successful in -1s
ci / gate (push) Failing after 15m3s
ci / gate (pull_request) Successful in 26m42s
10f6646f3e
Closes #608
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!612
No description provided.