Repository navigation
fix(cli): shell-quote hub invite arguments - #5065
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe hub invite command now shell-quotes pairing codes, URLs, and client lists. CLI tests verify quoting for normal values and values containing quotes or shell-significant syntax. ChangesHub invite shell quoting
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The invite command safely quotes its dynamic values, and no concrete merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
Motivation
ocx hub inviteprints a copy-and-run shell command that interpolates operator-supplied values. The--data-urlflag reacheshubInviteCommandraw — it is the one value not passed throughcanonicalHttpOrigin— so a URL-legal but shell-unsafe origin (userinfo with metacharacters, or simply a value with spaces) breaks or alters the pasted command. Quoting every dynamic value also hardens the printed line against any future source becoming less trusted.Description
src/cli/hub.tsand apply it to every dynamic value inhubInviteCommand: the pairing code, the data URL, the management URL, and the--clientspayload.Tests
bun test tests/cli/hub-invite.test.ts— 23 pass, covering the new quoting case and the updated printed-command expectations.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit