-
Notifications
You must be signed in to change notification settings - Fork 0
@coderabbitai #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@coderabbitai #18
Conversation
…t and add authentication manager
…te SecurityFilter
… in login response
…for API integration
…rove token validation error handling
…ronment variable management
…ables from .env file
…dEncoder instance
There was a problem hiding this 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 introduces several configuration improvements by replacing hard-coded values with environment variables, adds JWT-based authentication and security enhancements, and updates project dependencies and documentation accordingly.
- Replace sensitive configurations with env variable substitutions
- Add JWT token generation/validation and related security filters/configurations
- Update dependency management and documentation for the new security setup
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/application.properties | Updated datasource and API configs to use environment variables; added JWT secret property |
| src/main/resources/META-INF/spring.factories | Registered the custom Dotenv environment post-processor |
| src/main/java/com/otavio/aifoodapp/service/AuthorizationService.java | Changed user retrieval logic from Optional to a null check |
| src/main/java/com/otavio/aifoodapp/security/TokenService.java | Implemented JWT token generation/validation; introduced a method naming typo |
| src/main/java/com/otavio/aifoodapp/security/SecurityFilter.java | Added a servlet filter for JWT authentication |
| src/main/java/com/otavio/aifoodapp/security/SecurityConfig.java | Configured stateless security using a custom filter chain |
| src/main/java/com/otavio/aifoodapp/repository/UserRepository.java | Updated repository signature to return non-Optional UserDetails |
| src/main/java/com/otavio/aifoodapp/model/User.java | Added a new constructor and reformatted authority retrieval logic |
| src/main/java/com/otavio/aifoodapp/controller/AuthenticationController.java | Provided endpoints for login and registration with JWT support |
| Other DTO and config files | Added support classes and updated documentation to reflect the newly integrated features |
| pom.xml | Modified dependencies (switched to webflux, added JDBC, security, dotenv-java, java-jwt) |
| README.MD | Revised documentation for authentication, environment variable setup, and project architecture |
Comments suppressed due to low confidence (2)
src/main/java/com/otavio/aifoodapp/security/TokenService.java:47
- Method name 'genExperationDate' contains a typo; consider renaming it to 'generateExpirationDate' for clarity and consistency.
private Instant genExperationDate() {
pom.xml:38
- The inclusion of 'spring-boot-starter-webflux' may conflict with the existing servlet-based security filters and configurations; ensure that the reactive stack is intended alongside servlet components.
<artifactId>spring-boot-starter-webflux</artifactId>
No description provided.