Add OAuth 2.0 Protected Resource Metadata endpoint to Connect API#92
Add OAuth 2.0 Protected Resource Metadata endpoint to Connect API#92
Conversation
Summary of ChangesHello @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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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"], |
There was a problem hiding this comment.
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 }},There was a problem hiding this comment.
+1 (and likely add email to the default)
yoctozepto
left a comment
There was a problem hiding this comment.
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"], |
There was a problem hiding this comment.
+1 (and likely add email to the default)
Adds a new public endpoint
/.well-known/oauth-protected-resourceto the Connect API to provide OAuth 2.0 Protected Resource Metadata (as per RFC 9728).