| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Sorry, something went wrong.
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PR Found:PR #30022: fix(mcp): bind oauth callback to IPv4 loopback
|
Sorry, something went wrong.
|
Worth noting: MCP OAuth servers deployed behind AWS WAF with AWSManagedRulesCommonRuleSet will reject requests containing http://127.0.0.1 URLs in the body or query parameters. The GenericRFI_BODY and GenericRFI_QUERYARGUMENTS rules flag IP-literal URLs as potential Remote File Inclusion attacks and return 403 Forbidden. This affects both Dynamic Client Registration (redirect_uris in the JSON body) and the authorization redirect (redirect_uri query parameter) when the redirect URI uses the 127.0.0.1 form. RFC 8252 §7.3 recommends using localhost rather than IP literals for loopback redirect URIs in native OAuth apps. Using http://localhost:... avoids triggering these WAF rules entirely. Relevant AWS docs: AWS Managed Rules - Common Rule Set It would be good to make sure the default redirect URI in this refactor uses localhost rather than 127.0.0.1 to avoid this class of issues. |
Sorry, something went wrong.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Issue for this PR
Closes #31014.
Related to #7377, #18955, and #23787.
Type of change
What does this PR do?
This fixes MCP OAuth for environments where the browser reaches OpenCode through a public/proxied URL, but OpenCode still needs to listen on a local callback server. One example is OpenCode running inside a JupyterHub user server or another proxied container environment, where the browser sees a public URL that forwards back to the local callback listener.
Before this change, oauth.redirectUri was used for both the provider-facing OAuth redirect URI and for choosing the local callback listener port/path. That works for simple localhost flows, but breaks proxied setups.
This separates the two concerns:
How did you verify your code works?
Screenshots / recordings
N/A, CLI/OAuth behavior only.
Checklist