-
Notifications
You must be signed in to change notification settings - Fork 226
Refactor DI pattern of oauth package #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
9965866 to
de0c544
Compare
aa08863 to
f3de580
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #520 +/- ##
==========================================
- Coverage 60.63% 60.50% -0.14%
==========================================
Files 147 149 +2
Lines 19097 19076 -21
==========================================
- Hits 11580 11541 -39
- Misses 6188 6208 +20
+ Partials 1329 1327 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f3de580 to
38bce8b
Compare
38bce8b to
fa60fd5
Compare
ThaminduDilshan
approved these changes
Oct 21, 2025
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.
Part of #456
Further identified concerns created as separate git issue #550
This pull request introduces a significant refactor and centralization of OAuth service initialization, with a particular focus on the JWKS (JSON Web Key Set) service. The changes include consolidating OAuth service setup into a new
oauthpackage, refactoring the JWKS service for better modularity, and updating related configuration and tests. This improves maintainability, testability, and aligns the codebase with modern dependency injection patterns.Centralized OAuth Service Initialization:
internal/oauth/init.gofile with anInitializefunction that centralizes the setup and route registration for all OAuth-related services, including JWKS, token, introspection, and grant handlers. This replaces the previous scattered, legacy service initialization inservicemanager.go. [1] [2]JWKS Service Refactor:
internal/oauth/jwkspackage, merging sub-packages (constants,handler,model) into a single package and updating all related code and tests to use the new structure. The JWKS service is now initialized viajwks.Initialize, and the handler and service types have been renamed and simplified. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]Configuration and Dependency Injection Improvements:
servicemanager.goto use the new centralized OAuth initialization and removed direct registration of OAuth-related services, paving the way for improved dependency injection and future refactoring. [1] [2]Mock and Test Configuration Updates:
.mockery.public.ymland.mockery.private.ymlto reflect package renames and the new structure for mocks, consolidating mock directories and removing obsolete entries. [1] [2] [3] [4]These changes streamline OAuth service management, improve code organization, and prepare the codebase for further enhancements.