Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements CRUD operations for user management and token refresh/logout functionality for the API. It refactors authentication and user services to use abstract base classes and adds comprehensive middleware for token validation.
Key Changes
- Added User POST, PUT, and DELETE services with full test coverage
- Implemented token refresh and logout functionality with cache invalidation
- Refactored service classes to use AbstractUserService and AbstractAuthService base classes
- Added ValidateTokenRevokedMiddleware to check token validity against cache
Reviewed Changes
Copilot reviewed 38 out of 39 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Domain/Services/User/UserPostService.php | New service for creating users with validation and password hashing |
| src/Domain/Services/User/UserPutService.php | New service for updating users with validation |
| src/Domain/Services/User/UserDeleteService.php | New service for deleting users by ID |
| src/Domain/Services/User/AbstractUserService.php | Base class for user services with shared dependencies |
| src/Domain/Services/Auth/RefreshPostService.php | New service for refreshing JWT tokens |
| src/Domain/Services/Auth/LogoutPostService.php | New service for logging out users and invalidating tokens |
| src/Domain/Services/Auth/AbstractAuthService.php | Base class for auth services with shared dependencies |
| src/Domain/Components/Middleware/ValidateTokenRevokedMiddleware.php | Middleware to validate tokens against cache |
| src/Domain/Components/DataSource/User/UserRepository.php | Extended with insert, update, and delete methods |
| src/Domain/Components/Encryption/JWTToken.php | Added refresh token generation and refactored token creation |
| src/Domain/Components/Cache/Cache.php | Added token invalidation for user logout |
| src/Domain/Components/Enums/Http/RoutesEnum.php | Updated routes enum structure with new endpoints |
| tests/* | Comprehensive test coverage for all new services and middleware |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.