- Notifications
You must be signed in to change notification settings - Fork1.1k
refactor: move OAuth2 provider code to dedicated package#18746
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
ThomasK33 merged 1 commit intomainfromthomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_packageJul 3, 2025
Merged
refactor: move OAuth2 provider code to dedicated package#18746
ThomasK33 merged 1 commit intomainfromthomask33/07-03-refactor_oauth2_restructure_oauth2_provider_into_modular_packageJul 3, 2025
Uh oh!
There was an error while loading.Please reload this page.
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
This was referencedJul 3, 2025
MemberAuthor
ThomasK33 commentedJul 3, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
74ada5e to94f8522Comparejohnstcn approved these changesJul 3, 2025
665993d to5d752e3Compare94f8522 toc160ba6Compare5d752e3 toe8b598eComparec160ba6 to912fd87Comparee8b598e tod7cac75Compare912fd87 toa2737b7Compared7cac75 tocb75f3aComparea2737b7 to865dc56Comparef62413e to9965337Compare865dc56 to1f89b53Compare1f89b53 todb0f2a0Compare- Rename identityprovider package to oauth2provider for clarity- Extract OAuth2 business logic from coderd/oauth2.go into focused modules: - apps.go: OAuth2 app management (CRUD operations) - app_secrets.go: OAuth2 app secrets management - metadata.go: OAuth2 server and resource metadata endpoints - registration.go: RFC 7591/7592 dynamic client registration- Update route handlers to delegate to oauth2provider functions- Preserve all existing API endpoints and Swagger documentation- Fix compilation issues and update middleware references- All tests passing with zero regressionsThis refactoring improves code organization and maintainability whilepreserving complete API compatibility.Change-Id: Ieef7cf3683ec93667f09a0d4894190a1e1a0b16eSigned-off-by: Thomas Kosiewski <tk@coder.com>
db0f2a0 toa586976Comparec650133 intomain 30 checks passed
Uh oh!
There was an error while loading.Please reload this page.
MemberAuthor
ThomasK33 commentedJul 3, 2025
Merge activity
|
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
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.

Refactor OAuth2 Provider Code into Dedicated Package
This PR refactors the OAuth2 provider functionality by moving it from the main
coderdpackage into a dedicatedoauth2providerpackage. The change improves code organization and maintainability without changing functionality.Key changes:
oauth2providerpackage to house all OAuth2 provider-related codecoderd/identityproviderto the new packagehttp.HandlerFuncinstead of being handlers directlyapp_secrets.go- Manages OAuth2 application secretsapps.go- Handles OAuth2 application CRUD operationsauthorize.go- Implements the authorization flowmetadata.go- Provides OAuth2 metadata endpointsregistration.go- Handles dynamic client registrationrevoke.go- Implements token revocationsecrets.go- Manages secret generation and validationtokens.go- Handles token issuance and validationThis refactoring improves code organization and makes the OAuth2 provider functionality more maintainable while preserving all existing behavior.