Skip to content

Add OAuth 2.0 Protected Resource Metadata endpoint to Connect API#92

Open
mattbates wants to merge 3 commits intomainfrom
mb/add-oidc-discovery-endpoint
Open

Add OAuth 2.0 Protected Resource Metadata endpoint to Connect API#92
mattbates wants to merge 3 commits intomainfrom
mb/add-oidc-discovery-endpoint

Conversation

@mattbates
Copy link
Contributor

@mattbates mattbates commented Feb 6, 2026

Adds a new public endpoint /.well-known/oauth-protected-resource to the Connect API to provide OAuth 2.0 Protected Resource Metadata (as per RFC 9728).

@gemini-code-assist
Copy link

Summary of Changes

Hello @mattbates, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Connect API by implementing an OAuth 2.0 Protected Resource Metadata endpoint. This addition facilitates automatic discovery of key resource parameters by clients, streamlining integration with OAuth 2.0 authorization servers and improving the overall developer experience for applications interacting with the Connect API.

Highlights

  • OAuth 2.0 Protected Resource Metadata Endpoint: A new public endpoint /.well-known/oauth-protected-resource has been added to the Connect API to provide OAuth 2.0 Protected Resource Metadata.
  • Envoy Configuration Update: The Envoy configuration has been updated to support HTTP/1.1 for both application protocols and ALPN protocols, alongside HTTP/2.
  • Public Discovery Endpoint: The new endpoint serves a static JSON response detailing the resource URL, authorization servers, supported scopes (openid, profile, offline_access), and bearer methods.
  • Authentication Exemption: JWT authentication is explicitly disabled for the /.well-known/oauth-protected-resource endpoint, making it publicly accessible for discovery.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • charts/cofide-connect/templates/configmap-envoy.yaml
    • Enabled HTTP/1.1 support in Envoy's filter chain and TLS ALPN protocols.
    • Added a new Envoy route for /.well-known/oauth-protected-resource to serve a direct JSON response.
    • Configured the new route to return a Content-Type: application/json header.
    • Disabled JWT authentication specifically for the new discovery endpoint.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mattbates mattbates self-assigned this Feb 6, 2026
@mattbates mattbates added this to the now milestone Feb 6, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an OAuth 2.0 Protected Resource Metadata endpoint (/.well-known/oauth-protected-resource) to the Connect API, following RFC 9207. The implementation correctly adds a new route in the Envoy configuration with a direct JSON response and disables authentication for this public endpoint. Additionally, HTTP/1.1 is enabled for the Connect API to improve client compatibility. The changes are well-implemented. I've added one suggestion to make the list of supported scopes configurable for better flexibility.

{
"resource": "https://connect.{{ .Values.connect.urlBase }}",
"authorization_servers": ["{{ .Values.envoy.auth.issuer }}"],
"scopes_supported": ["openid", "profile", "offline_access"],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The list of supported scopes is currently hardcoded. To improve flexibility and maintainability, consider making this list configurable through values.yaml. You can provide a default list if no configuration is specified.

For example, you could introduce a envoy.auth.scopesSupported value and use Helm's toJson function to render it.

                                      "scopes_supported": {{ .Values.envoy.auth.scopesSupported | default (list "openid" "profile" "offline_access") | toJson }},

Copy link
Member

@yoctozepto yoctozepto Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 (and likely add email to the default)

Copy link
Member

@yoctozepto yoctozepto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs addressing Gemini's comment.

Also note that you have email included in the default set of scopes elsewhere. It would be best if the two sets were in sync.

{
"resource": "https://connect.{{ .Values.connect.urlBase }}",
"authorization_servers": ["{{ .Values.envoy.auth.issuer }}"],
"scopes_supported": ["openid", "profile", "offline_access"],
Copy link
Member

@yoctozepto yoctozepto Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 (and likely add email to the default)

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.

3 participants