Skip to content

Feat/auth migration#241

Merged
locnguyen1986 merged 9 commits intomainfrom
feat/auth-migration
Nov 13, 2025
Merged

Feat/auth migration#241
locnguyen1986 merged 9 commits intomainfrom
feat/auth-migration

Conversation

@locnguyen1986
Copy link
Collaborator

Fix redirect
fix project and conversations

Copilot AI review requested due to automatic review settings November 13, 2025 18:33
@locnguyen1986 locnguyen1986 merged commit 1da8ddc into main Nov 13, 2025
3 checks passed
@locnguyen1986 locnguyen1986 deleted the feat/auth-migration branch November 13, 2025 18:33
@github-project-automation github-project-automation bot moved this to QA in Jan Nov 13, 2025
Copy link
Contributor

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 implements authentication migration improvements by fixing redirect URL handling in the Keycloak OAuth flow and adding support for project public IDs in conversations.

Key changes:

  • Fixed OAuth redirect URL to be properly stored and retrieved during the authentication callback flow
  • Added project_public_id field to conversations across all layers (database, domain, service, handlers, responses)
  • Enhanced GetMe endpoint to include a name field with username fallback

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/llm-api/migrations/000004_add_project_public_id_to_conversations.up.sql Adds database column and index for storing project public IDs in conversations
services/llm-api/migrations/000004_add_project_public_id_to_conversations.down.sql Provides rollback migration to remove project_public_id column
services/llm-api/internal/domain/conversation/conversation.go Adds ProjectPublicID field to Conversation domain model
services/llm-api/internal/domain/conversation/conversation_service.go Updates CreateConversationInput to include ProjectPublicID and sets it during conversation creation
services/llm-api/internal/infrastructure/database/dbschema/conversation.go Adds ProjectPublicID field to database schema and updates conversion methods
services/llm-api/internal/interfaces/httpserver/handlers/conversationhandler/conversation_handler.go Extracts and passes project public ID when creating conversations
services/llm-api/internal/interfaces/httpserver/responses/conversation/conversation.go Adds project_id field to API response structure
services/llm-api/internal/interfaces/httpserver/handlers/authhandler/token_handler.go Adds Name field to GetMe response with username fallback logic
services/llm-api/internal/interfaces/httpserver/handlers/authhandler/keycloak_oauth.go Fixes redirect URL handling by storing it during login initiation and retrieving it during callback

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +179 to +181
// Default redirect URL if not provided
redirectURL = "https://chat-dev.jan.ai/auth/keycloak/callback"
}
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

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

The default redirect URL is hardcoded to a development environment URL (https://chat-dev.jan.ai/auth/keycloak/callback). This should be configurable or retrieved from configuration to support different environments (development, staging, production). Consider adding this as a configuration parameter similar to how h.redirectURI is configured and passed to the handler constructor.

Copilot uses AI. Check for mistakes.
Comment on lines 283 to 285
if redirectURL == "" {
// Default redirect URL if not provided
redirectURL = "https://chat-dev.jan.ai/auth/keycloak/callback"
}
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

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

The default redirect URL is hardcoded to a development environment URL (https://chat-dev.jan.ai/auth/keycloak/callback). This should be configurable or retrieved from configuration to support different environments (development, staging, production). Consider adding this as a configuration parameter similar to how h.redirectURI is configured and passed to the handler constructor.

Copilot uses AI. Check for mistakes.
@locnguyen1986 locnguyen1986 restored the feat/auth-migration branch November 26, 2025 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

2 participants