Phase 5 + 6: Spring Boot 1.5 → 3.3 / Java 17 / Jakarta + Spring Security 6 rewrite - #51
Open
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Bump spring-boot-starter-parent to 2.7.18, keep javax.* and Java 8 - Switch MySQL driver to com.mysql:mysql-connector-j coordinates - Add junit-vintage-engine so the JUnit 4 safety-net tests run on JUnit 5 platform - Replace removed CrudRepository.findOne(id) with findById(id).orElse(null) - Extract BCryptPasswordEncoder into PasswordEncoderConfig to break the SecurityConfig self-referential bean cycle (prohibited since Boot 2.6) - allow-circular-references=true for the mutual service-layer dependencies - H2 test URL: NON_KEYWORDS=USER (H2 2.x reserves USER) All 37 backend tests pass on Java 8. Co-Authored-By: Gael Kekatos <gael.kekatos@cognition.ai>
…curity 6 (Phase 5b & 6) Phase 5b: - spring-boot-starter-parent 2.7.18 -> 3.3.5, java.version 17 - Migrate all javax.persistence/javax.servlet imports to jakarta.* across the 9 domain classes - Hibernate 6 dialect: MySQL5Dialect (removed) -> MySQLDialect - CI backend job now runs on JDK 17 Phase 6 (Spring Security 6 rewrite): - Drop WebSecurityConfigurerAdapter; define a SecurityFilterChain bean and a DaoAuthenticationProvider instead of configureGlobal - EnableGlobalMethodSecurity -> EnableMethodSecurity - Enable CSRF (Spring Security default); exempt the cross-origin /api/** SPA namespace (relies on CORS allowlist + session), full SPA CSRF is Phase 7 - Configure CORS via Spring Security with an explicit http://localhost:4200 allowlist and retire the hand-rolled RequestFilter - Fix invalid /error/**/* matcher for the Spring 6 PathPattern parser All 37 backend tests pass on Java 17. Co-Authored-By: Gael Kekatos <gael.kekatos@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Incremental backend framework upgrade (stacked on the Phase 4 PR #50). Done in two verified hops, each with all 37 integration tests green, then the Spring Security 6 rewrite (Phase 6) folded into the 3.x step per the plan.
Phase 5a — Spring Boot 1.5.4 → 2.7.18 (still Java 8,
javax.*)spring-boot-starter-parent→2.7.18.mysql:mysql-connector-java→com.mysql:mysql-connector-j.CrudRepository.findOne(id)(removed) →findById(id).orElse(null).BCryptPasswordEncoderintoPasswordEncoderConfig—SecurityConfigboth defined and consumed it, which is a self-referential bean cycle now that Boot 2.6+ prohibits circular references.spring.main.allow-circular-references=truefor the genuine mutualUserService↔AccountService↔TransactionServicedependencies (documented; refactoring the service graph is out of scope for a safety-net upgrade).junit-vintage-engineso the JUnit 4 safety-net suite runs on the JUnit 5 platform.NON_KEYWORDS=USER(H2 2.x now reservesUSER, and theUserentity maps to tableuser).Phase 5b — Spring Boot 2.7.18 → 3.3.5, Java 17, Jakarta
3.3.5,java.version→17; CI backend job → JDK 17.javax.persistence/javax.servletimport tojakarta.*across the 9 domain classes.MySQL5Dialect→MySQLDialect.Phase 6 — Spring Security 6 rewrite
@EnableGlobalMethodSecurity→@EnableMethodSecurity..csrf().disable()). Server-rendered Thymeleaf forms get the token automatically viath:action; the cross-origin/api/**SPA namespace is exempted (ignoringRequestMatchers) and relies on the CORS allowlist + authenticated session.http://localhost:4200allowlist (methods/headers/credentials mirror the old filter), and the hand-rolledRequestFilteris removed./error/**/*matcher (Spring 6PathPatternrequires**to be terminal) →/error/**.Follow-ups / coordination
/indexlogin and full SPA CSRF integration are deferred there.Verified:
mvn clean teston JDK 17 → 37 tests, 0 failures; Spring context loads with the new security config.Link to Devin session: https://app.devin.ai/sessions/82be2e41fda54343a20a9b73e01c0631
Requested by: @gaelkekatos-jpg
Devin Review