Repository navigation
fix(oauth): start provider login with an authenticated POST - #109
Merged
Merged
Conversation
Windows release builds failed to compile: code-plugins imported Path only for the non-Windows branch, and code-runtime declared an unused mut on the Windows hook builder. Test-only Unix APIs (PermissionsExt, unix symlinks) are now gated behind cfg(unix) so the test targets also compile on Windows. Verified with cargo check --target x86_64-pc-windows-gnu --tests for cli, code-runtime, code-plugins, code-tools, code-server, code-sandbox and code-core. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The authorize route was a GET redirect. A browser navigation cannot send the x-api-key header that the control-plane key middleware requires, so the browser login flow broke when that key requirement landed. Start the flow with an authenticated POST that returns the provider URL as JSON, which the caller opens itself. Also percent-encode the authorize URL parameters with Url::parse_with_params. The previous string format left redirect_uri and scope unencoded. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GETredirect, but the control-plane key is sent as a header, and a browser navigation cannot send that header. The browser flow was broken by the key requirement. It is nowPOST /v1/oauth/:provider/authorize(key required), which returns{ "provider", "authorize_url" }. The caller opens that URL.Url::parse_with_params, soredirect_uriandscopeare percent-encoded. A test covers injection attempts through both values.Behaviour change
Callers that used
GET /v1/oauth/:provider/authorizemust switch to the authenticatedPOSTand open the returnedauthorize_url. No callers in this repo used the GET route.Verification
cargo test -p code-serverpasses, including the new encoding test and the updated auth test (POST with and without the key).🤖 Generated with Claude Code