Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the authentication architecture by consolidating token generation and cookie management within the auth provider layer, removing the previous split responsibility between controllers and providers.
Changes:
- Removed
AuthResponseschema from OpenAPI spec since authentication now returns 200 with cookies only - Moved token generation and cookie setting into auth providers (
BasicProviderandClerkProvider) - Changed provider interface from
Validate()returning*store.AdmintoAuthenticate()returningcontext.Context - Consolidated session retrieval and cookie management utilities into
authpackage - Removed unused platform proxy configuration and
PlatformURLenvironment variable
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| services/nexus/internal/http/controllers/v1/management/oapi/resources.yml | Removed AuthResponse schema and 200 response content from auth callback endpoint |
| services/nexus/internal/http/controllers/v1/management/oapi/resources_gen.go | Generated code reflecting OpenAPI spec changes |
| services/nexus/internal/http/controllers/v1/management/http.go | Removed platform proxy setup and unused imports |
| services/nexus/internal/http/controllers/v1/management/auth.go | Refactored to use new provider interface and removed token/cookie logic |
| services/nexus/internal/http/auth/providers/provider.go | Added factory function and updated interface to handle authentication with cookie setting |
| services/nexus/internal/http/auth/providers/basic.go | Implemented token generation and cookie setting within authenticate method |
| services/nexus/internal/http/auth/providers/clerk.go | Implemented JWT validation and admin creation/retrieval with updated interface |
| services/nexus/internal/http/auth/providers/token.go | Simplified generator by removing issuer parameter |
| services/nexus/internal/http/auth/auth.go | Moved session utilities from clerk.go and added SetSessionCookie helper |
| services/nexus/internal/config/config.go | Removed unused PlatformURL configuration |
| services/console/src/views/auth/Login.tsx | Updated to handle redirect client-side after successful authentication |
| services/console/src/api.ts | Removed redirect parameter from basicAuth and fixed 401 redirect on login page |
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.
This PR improves the auth provider design ensuring the cookies and token generation is done within the auth provider.