Closed
Conversation
Adds chat history retrieval, search, delete, and rename functionalities, enhancing user chat management capabilities. Integrates CustomOAuth2UserService for user authentication and authorization. Updates user model with fields from OAuth2, facilitating seamless user data handling.
Added Files: - user/UserService.java: Service layer for user operations with @transactional support - chat/dto/ChatRenameRequest.java: DTO with validation annotations for chat rename requests - error/UnauthorizedAccessException.java: Custom exception for authorization failures (403) - error/ChatNotFoundException.java: Custom exception for chat not found errors (404) Modified Files: - chat/controller/ChatController.java: Added @Valid annotation and userId parameters for authorization - chat/service/ChatService.java: Implemented ownership validation for all chat operations - error/GlobalExceptionHandler.java: Added handlers for UnauthorizedAccessException and ChatNotFoundException - security/CustomOAuth2UserService.java: Standardized to use "sub" claim and added null checks - user/model/Users.java: Changed ID type from UUID to String for OAuth2 compatibility Key Changes: - Transaction management: Streak operations now use @transactional in service layer - Input validation: Bean Validation added for chat rename with @notblank, @SiZe, @pattern - Authorization: All chat operations now verify user ownership before execution - Security: Consistent exception handling across authentication and authorization flows Breaking Changes: - ChatService methods now require userId parameter for authorization checks - Users entity ID changed from UUID to String
Enhances OAuth2 user authentication by adding checks to ensure the principal is an OidcUser and provides fallback mechanism to fetch email. Refactors chat title validation by introducing a constant for the title pattern, improving code readability and maintainability. Adds documentation explaining the streak freeze count.
Implement transaction management, validation, and authorization
Improves the `UserNotAuthenticatedException` by adding constructors to handle more specific error messages and include a cause. This provides better context and debugging information when a user is not properly authenticated.
Enhances UserNotAuthenticatedException
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.
No description provided.