fix(auth): strip controls from masked API keys - #96445
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed June 25, 2026, 5:16 PM ET / 21:16 UTC. Summary PR surface: Source +12, Tests +7. Total +19 across 2 files. Reproducibility: yes. from source inspection: current Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused masker and regression test after normal maintainer merge gates, while keeping raw secret input normalization in the adjacent companion PR. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current Is this the best way to solve the issue? Yes. Changing the shared diagnostic masker is the narrowest maintainable fix for the display problem; raw secret input normalization remains a separate boundary handled by #96444. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 13ecca5408cb. Label changesLabel justifications:
Evidence reviewedPR surface: Source +12, Tests +7. Total +19 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
* fix(auth): strip controls from masked API keys * test(auth): cover DEL and C1 masked key controls * chore: retrigger PR checks --------- Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com> (cherry picked from commit 2906d6c)
* fix(auth): strip controls from masked API keys * test(auth): cover DEL and C1 masked key controls * chore: retrigger PR checks --------- Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com>
* fix(auth): strip controls from masked API keys * test(auth): cover DEL and C1 masked key controls * chore: retrigger PR checks --------- Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com>
* fix(auth): strip controls from masked API keys * test(auth): cover DEL and C1 masked key controls * chore: retrigger PR checks --------- Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com> (cherry picked from commit 2906d6c)
What Problem This Solves
maskApiKey()trims credential-like values before redacting them, but embedded control characters were preserved in the masked diagnostic output. A copied value containing a newline or NUL could therefore make masked auth/setup text multiline or carry invisible control bytes even though the secret itself was redacted.Why This Change Was Made
The masker now strips C0/C1/DEL control characters before applying the existing length-based redaction rules. This keeps the same visible masking format for printable values while making diagnostic output single-line/control-free.
A focused regression test covers newline, NUL, and all-control input.
User Impact
Onboarding, auth overview, and directive responses that display masked credentials no longer echo hidden control characters from malformed input.
Evidence
Direct behavior probe:
Targeted test:
Formatting:
Whitespace:
AI-assisted
Prepared with Codex. I reviewed the change, understand the touched code path, and kept the PR focused on the bug described above.