Conversation
Member
appleboy
commented
Mar 3, 2026
- Introduce full GitLab OAuth support, including provider implementation, configuration, bootstrap wiring, and login UI icon
- Refactor Gitea user info fetching to use a precomputed API URL instead of deriving it from the auth endpoint
- Add a shared apiURL field to OAuth providers for cleaner and more consistent user info requests
- Add comprehensive test coverage for GitHub, Gitea, GitLab, and Microsoft OAuth providers, including success paths and error cases
- Improve provider constructors to normalize base URLs by stripping trailing slashes
- Extend provider dispatch logic to handle GitLab and add tests for unsupported providers and display names
- Introduce full GitLab OAuth support, including provider implementation, configuration, bootstrap wiring, and login UI icon - Refactor Gitea user info fetching to use a precomputed API URL instead of deriving it from the auth endpoint - Add a shared apiURL field to OAuth providers for cleaner and more consistent user info requests - Add comprehensive test coverage for GitHub, Gitea, GitLab, and Microsoft OAuth providers, including success paths and error cases - Improve provider constructors to normalize base URLs by stripping trailing slashes - Extend provider dispatch logic to handle GitLab and add tests for unsupported providers and display names Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds GitLab as a first-class OAuth provider and standardizes instance-based OAuth providers by introducing a precomputed apiURL for user-info fetching, alongside expanded provider test coverage.
Changes:
- Add GitLab OAuth support end-to-end (config/env, bootstrap wiring, provider implementation, login-page icon).
- Refactor Gitea user-info fetching to use a precomputed API URL and add
apiURLto provider struct for consistency. - Add/expand unit tests across OAuth providers (GitHub, Gitea, GitLab, Microsoft), including success and error paths.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/templates/login_page.templ | Adds GitLab icon rendering for OAuth login buttons. |
| internal/config/config.go | Adds GitLab OAuth configuration fields and env loading. |
| internal/bootstrap/oauth.go | Wires GitLab provider initialization into bootstrap/provider registry. |
| internal/auth/oauth_provider.go | Adds apiURL, normalizes base URLs, adds GitLab provider constructor, dispatches GitLab user info. |
| internal/auth/oauth_gitea.go | Switches Gitea user-info fetch to use p.apiURL. |
| internal/auth/oauth_gitlab.go | Implements GitLab /api/v4/user user-info fetch and mapping. |
| internal/auth/oauth_provider_test.go | Adds shared testing utilities and tests for display name + unsupported providers. |
| internal/auth/oauth_github_test.go | Adds GitHub provider constructor + user-info tests (including email fallback behavior). |
| internal/auth/oauth_gitea_test.go | Adds Gitea provider constructor + user-info tests (including error cases). |
| internal/auth/oauth_gitlab_test.go | Adds GitLab provider constructor + user-info tests (including error cases). |
| internal/auth/oauth_microsoft_test.go | Adds Microsoft provider constructor + user-info tests (including error cases). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add styling for a GitLab OAuth login button, including colors, hover effects, and SVG icon sizing Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.