fix: escape Rich fragments in CLI status messages - #13088
Conversation
|
Additional validation on the published branch head
This PR intentionally follows up on the broader status-message surfaces noted in the review discussion for #12977. #12977 is still the smaller config-only fix; this one includes auth message/error details plus focused regression coverage for the new issue #13086. |
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Updated this PR to cover the generic pretty-mode error rendering path too. New branch head: Follow-up changes:
Validation on the published branch head: fetched and Python-compiled the touched files successfully:
No payout details are posted here; bounty/payment discussion can stay private if maintainers decide to award one after review/merge. |
|
Thanks @JayyBG — reviewed against #13086 and verified end to end. This is a clean fix for a real bug class. What I verified
Follow-up (non-blocking, not this PR's job): the same unescaped pattern remains in sibling commands — No CI has run on this head yet (no check-runs or statuses), so hosted CI remains the authority on the full suite. Nice work — especially the renderer-boundary escape and the JSON-contract test. Merge needs maintainer sign-off (security-labeled change, first-time contributor, and the proposed bounty in the description is a maintainer call); leaving for human maintainer review. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Thanks for the thorough verification. I restored the trailing newline in |
|
Upstream changed underneath this branch after #12963 and #12977 merged. I rechecked current |
Several CLI status/error messages interpolate user-controlled profile names and config values into Rich markup strings. Markup-like values such as
bad[/bold]profilecan make a command fail while rendering the success/error message, even after the state change has already happened.This patch escapes dynamic fragments in
configandauthstatus messages while preserving CLI-owned Rich styling. It also escapesRenderer.error()message/detail output at the pretty-mode renderer boundary, leaving JSON-mode stderr payloads raw and machine-readable.Regression coverage includes:
config profile usewith a markup-like profile nameconfig setwith a markup-like profile name and valueconfig profile deleteno-such-profile error renderingauth logoutwith a markup-like profile nameauth refreshpretty error details for an API-key profile with a markup-like name--json auth refreshpreserving the raw profile name in stderr JSON detailsFixes #13086.
This contribution is AI-assisted. A small US$5 PayPal bounty was proposed on #13086; no award or payment is assumed, and payout details will remain private unless maintainers approve payment after acceptance/merge.
Validation: fetched the published branch head and Python-compiled the touched files successfully. Hosted CI remains authoritative for the complete suite.