fix(cli): validate cloud login URL before auto-open#80
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
5305802 to
971ae61
Compare
Motivation
verification_uri(_complete)directly toopen::that_detached, which can invoke arbitrary OS protocol handlers if the daemon/auth response contains a non-HTTP(S) scheme.Description
is_allowed_browser_uriwhich accepts onlyhttp/httpsschemes and usingreqwest::Url::parseto validate the value.--no-openif trusted, preserving existing outputs otherwise.cloud_login_refuses_auto_open_for_non_http_uritocrates/hypercolor-cli/tests/request_shape_tests.rsthat exercises ahypercolor-test://verification URI and asserts the refusal warning appears.crates/hypercolor-cli/src/commands/cloud.rsandcrates/hypercolor-cli/tests/request_shape_tests.rs.Testing
cloud_login_refuses_auto_open_for_non_http_uri(included incrates/hypercolor-cli/tests/request_shape_tests.rs).just test-crate hypercolor-clibutjustis not available in this environment, so it was not executed here.cargo test -p hypercolor-cli; the build/test run was started in the environment but did not complete within the session constraints (compilation is large), so a full test run could not be observed here.Codex Task