Skip to content

Improved auth provider design#124

Merged
jeroenrinzema merged 5 commits intomainfrom
feat/auth
Jan 28, 2026
Merged

Improved auth provider design#124
jeroenrinzema merged 5 commits intomainfrom
feat/auth

Conversation

@jeroenrinzema
Copy link
Copy Markdown
Contributor

This PR improves the auth provider design ensuring the cookies and token generation is done within the auth provider.

@jeroenrinzema jeroenrinzema requested a review from Copilot January 28, 2026 20:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AuthResponse schema from OpenAPI spec since authentication now returns 200 with cookies only
  • Moved token generation and cookie setting into auth providers (BasicProvider and ClerkProvider)
  • Changed provider interface from Validate() returning *store.Admin to Authenticate() returning context.Context
  • Consolidated session retrieval and cookie management utilities into auth package
  • Removed unused platform proxy configuration and PlatformURL environment 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

Comment thread services/nexus/internal/http/controllers/v1/management/auth.go Outdated
Comment thread services/nexus/internal/http/auth/providers/clerk.go
Comment thread services/nexus/internal/http/auth/providers/basic.go Outdated
Comment thread services/nexus/internal/http/auth/providers/clerk_test.go
Comment thread services/console/src/views/auth/Login.tsx
@jeroenrinzema jeroenrinzema merged commit c428616 into main Jan 28, 2026
4 checks passed
@jeroenrinzema jeroenrinzema deleted the feat/auth branch January 28, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants