Skip to content

Conversation

@OtavioXimarelli
Copy link
Owner

No description provided.

OtavioXimarelli and others added 30 commits June 1, 2025 23:32
@OtavioXimarelli OtavioXimarelli changed the title Spring security implementation @sourcery-ai Jun 10, 2025
@OtavioXimarelli OtavioXimarelli requested a review from Copilot June 10, 2025 14:42
Copy link

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 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>

@OtavioXimarelli OtavioXimarelli changed the title @sourcery-ai @coderabbitai Jun 10, 2025
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