From 3b6a6969283361dddb70526375bbdc1b8df334b8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 13:37:17 +0000 Subject: [PATCH 1/2] fix: upgrade UserFront to Spring Boot 2.7.18 to clear spring-security-core CVE-2022-22976 --- UserFront/pom.xml | 6 +++--- .../src/main/java/com/userFront/config/SecurityConfig.java | 4 ++-- .../service/UserServiceImpl/AppointmentServiceImpl.java | 2 +- UserFront/src/main/resources/application.properties | 7 +++++++ .../test/java/com/userFront/UserFrontApplicationTests.java | 5 +---- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/UserFront/pom.xml b/UserFront/pom.xml index 902ec2b3..87830a4e 100644 --- a/UserFront/pom.xml +++ b/UserFront/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.4.RELEASE + 2.7.18 @@ -46,8 +46,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j diff --git a/UserFront/src/main/java/com/userFront/config/SecurityConfig.java b/UserFront/src/main/java/com/userFront/config/SecurityConfig.java index 40b10417..3931511f 100644 --- a/UserFront/src/main/java/com/userFront/config/SecurityConfig.java +++ b/UserFront/src/main/java/com/userFront/config/SecurityConfig.java @@ -67,8 +67,8 @@ protected void configure(HttpSecurity http) throws Exception { - @Autowired - public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { // auth.inMemoryAuthentication().withUser("user").password("password").roles("USER"); //This is in-memory authentication auth.userDetailsService(userSecurityService).passwordEncoder(passwordEncoder()); } diff --git a/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java b/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java index 838ad223..0d62b84c 100644 --- a/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java +++ b/UserFront/src/main/java/com/userFront/service/UserServiceImpl/AppointmentServiceImpl.java @@ -24,7 +24,7 @@ public List findAll() { } public Appointment findAppointment(Long id) { - return appointmentDao.findOne(id); + return appointmentDao.findById(id).orElse(null); } public void confirmAppointment(Long id) { diff --git a/UserFront/src/main/resources/application.properties b/UserFront/src/main/resources/application.properties index d7e04942..635f03ee 100644 --- a/UserFront/src/main/resources/application.properties +++ b/UserFront/src/main/resources/application.properties @@ -1,3 +1,10 @@ +# =============================== +# = SPRING +# =============================== + +# UserServiceImpl and AccountServiceImpl depend on each other +spring.main.allow-circular-references = true + # =============================== # = DATA SOURCE # =============================== diff --git a/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java b/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java index 81fed97b..3e51f21d 100644 --- a/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java +++ b/UserFront/src/test/java/com/userFront/UserFrontApplicationTests.java @@ -1,11 +1,8 @@ package com.userFront; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; -@RunWith(SpringRunner.class) @SpringBootTest public class UserFrontApplicationTests { From fa17bee66d4e58fc12d3d0112ebca286e3eee84b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 13:59:27 +0000 Subject: [PATCH 2/2] fix: keep IDENTITY id generation after Boot 2.7 upgrade (use-new-id-generator-mappings=false) --- UserFront/src/main/resources/application.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UserFront/src/main/resources/application.properties b/UserFront/src/main/resources/application.properties index 635f03ee..6aef4cbd 100644 --- a/UserFront/src/main/resources/application.properties +++ b/UserFront/src/main/resources/application.properties @@ -37,6 +37,9 @@ spring.jpa.show-sql = true # the project spring.jpa.hibernate.ddl-auto = update +# Keep Boot 1.5's IDENTITY mapping for GenerationType.AUTO (no hibernate_sequence) +spring.jpa.hibernate.use-new-id-generator-mappings = false + # Allows Hibernate to generate SQL optimized for a particular DBMS spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect