Conversation
Summary of ChangesHello, 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 introduces a comprehensive restructuring of the OAuth client management system. The core Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly refactors OAuth2 client management to align with RFC 7591. Key changes include expanding the OAuthClient domain model with new fields like Description, ClientType, TokenEndpointAuthMethod, and per-client AccessTokenTTL/RefreshTokenTTL, with corresponding database schema updates. The client registration process is unified into a single RegisterClient service method, replacing separate confidential and public client registration. Token issuance logic now respects these per-client TTLs. A new EnsureClient function is added to idempotently create or update clients, replacing the previous EnsurePublicClient.
Feedback includes updating GetPublicClient to use the new client_type field for consistency, correcting the EnsureClient function's logic for updating slice fields to allow explicit clearing, removing redundant comments in domain/token.go, and improving error logging when fetching client details for TTL overrides in oauth.go.
| clientType = "confidential" | ||
| authMethod = "client_secret_basic" | ||
| } else { | ||
| clientType = "public" |
There was a problem hiding this comment.
With the introduction of the client_type field, other parts of the codebase that deal with public clients should be updated to use this field for checks.
Specifically, GetPublicClient (and its underlying repository method GetPublicByClientID) still seems to identify public clients by checking for an empty client_secret. This logic should be updated to check client_type = 'public' instead, to be consistent with the new data model. While the relevant code is not in this diff, this is a critical part of this refactoring to ensure correctness and maintainability.
Summary
Type of change
Testing
Impact / Risks
📸 Screenshots / Logs (if applicable)