Skip to content

Restrict OAuth proxy redirect URLs#8

Draft
rnovatorov wants to merge 2 commits intomainfrom
restrict-oauth-redirect-urls-12195343495812603582
Draft

Restrict OAuth proxy redirect URLs#8
rnovatorov wants to merge 2 commits intomainfrom
restrict-oauth-redirect-urls-12195343495812603582

Conversation

@rnovatorov
Copy link
Member

Added support for restricting allowed redirect URLs in the OAuth proxy via CLI argument and environment variable. Modified OAuthProxyConfig, ServeCommand, and Server to propagate this configuration. Included a new unit test for verification.


PR created automatically by Jules for task 12195343495812603582 started by @rnovatorov

This change adds support for restricting the allowed redirect URLs in the
OAuth proxy. It introduces a new configuration option
`allowed_redirect_urls` in `OAuthProxyConfig`, which can be set via the
`--oauth-proxy-allowed-redirect-urls` CLI argument or the
`ENAPTER_OAUTH_PROXY_ALLOWED_REDIRECT_URLS` environment variable.

The restricted URLs are passed to the underlying `fastmcp` OAuthProxy
implementation to enhance security by preventing open redirect
vulnerabilities.

Added a unit test to verify the CLI argument parsing logic.

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Add support for restricting allowed redirect URLs in the OAuth proxy.
- URLs can be set via `--oauth-proxy-allowed-redirect-urls` CLI argument or
  `ENAPTER_OAUTH_PROXY_ALLOWED_REDIRECT_URLS` environment variable.
- Pass restricted URLs to the underlying `fastmcp` OAuthProxy.
- Add unit test for CLI argument parsing.
- Reformat code with black and isort.
- Fix unused imports in tests.

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant