Skip to content

Commit 621dc81

Browse files
committed
2 parents 19e5c03 + 8e5b421 commit 621dc81

File tree

13 files changed

+134
-119
lines changed

13 files changed

+134
-119
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25">
44
<attributes>
55
<attribute name="module" value="true"/>
66
<attribute name="maven.pomderived" value="true"/>

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v3
42+
uses: github/codeql-action/init@v4
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,12 +50,12 @@ jobs:
5050
uses: actions/setup-java@v3
5151
with:
5252
distribution: 'temurin'
53-
java-version: 24
53+
java-version: 25
5454

5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
5757
- name: Autobuild
58-
uses: github/codeql-action/autobuild@v3
58+
uses: github/codeql-action/autobuild@v4
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 https://git.io/JvXDl
@@ -69,4 +69,4 @@ jobs:
6969
# make release
7070

7171
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v3
72+
uses: github/codeql-action/analyze@v4

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ To test the setup the application has to be started and the Docker Images for Pr
5252

5353
## Setup
5454

55-
MongoDB 4.4.x or newer.
55+
MongoDB 6.0.x or newer.
5656

5757
Eclipse IDE for Enterprise Java and Web Developers newest version.
5858

5959
Maven 3.9.5 or newer.
6060

61-
Java 21 or newer
61+
Java 25 or newer
6262

63-
Nodejs 18.19.x or newer
63+
Nodejs 22.16.x or newer
6464

65-
Npm 10.2.x or newer
65+
Npm 10.9.x or newer
6666

67-
Angular Cli 18 or newer.
67+
Angular Cli 20 or newer.

backend/pom.xml

Lines changed: 97 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -28,74 +28,114 @@ the specific language governing permissions and limitations under the License. -
2828
</license>
2929
</licenses>
3030
<dependencies>
31-
<dependency>
32-
<groupId>org.springframework.boot</groupId>
33-
<artifactId>spring-boot-starter-integration</artifactId>
34-
</dependency>
35-
<dependency>
36-
<groupId>org.springframework.boot</groupId>
37-
<artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
38-
</dependency>
39-
<dependency>
40-
<groupId>org.springframework.boot</groupId>
41-
<artifactId>spring-boot-starter-security</artifactId>
42-
</dependency>
43-
<dependency>
44-
<groupId>org.springframework.boot</groupId>
45-
<artifactId>spring-boot-starter-web</artifactId>
46-
</dependency>
47-
<dependency>
48-
<groupId>org.springframework.boot</groupId>
49-
<artifactId>spring-boot-starter-websocket</artifactId>
50-
</dependency>
51-
<dependency>
52-
<groupId>org.springframework.boot</groupId>
53-
<artifactId>spring-boot-starter-webflux</artifactId>
54-
</dependency>
55-
<dependency>
56-
<groupId>org.springframework.boot</groupId>
57-
<artifactId>spring-boot-starter-mail</artifactId>
58-
</dependency>
59-
<dependency>
60-
<groupId>org.springframework.boot</groupId>
61-
<artifactId>spring-boot-starter-actuator</artifactId>
62-
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter-actuator</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter-restclient</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.springframework.boot</groupId>
45+
<artifactId>spring-boot-starter-webmvc</artifactId>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.springframework.boot</groupId>
49+
<artifactId>spring-boot-starter-mail</artifactId>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.springframework.boot</groupId>
53+
<artifactId>spring-boot-starter-security</artifactId>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-starter-validation</artifactId>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.springframework.boot</groupId>
61+
<artifactId>spring-boot-starter-webclient</artifactId>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.springframework.boot</groupId>
65+
<artifactId>spring-boot-starter-webflux</artifactId>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.springframework.boot</groupId>
69+
<artifactId>spring-boot-starter-websocket</artifactId>
70+
</dependency>
71+
72+
<dependency>
73+
<groupId>io.micrometer</groupId>
74+
<artifactId>micrometer-registry-prometheus</artifactId>
75+
<scope>runtime</scope>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.springframework.boot</groupId>
79+
<artifactId>spring-boot-starter-actuator-test</artifactId>
80+
<scope>test</scope>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.springframework.boot</groupId>
84+
<artifactId>spring-boot-starter-data-mongodb-reactive-test</artifactId>
85+
<scope>test</scope>
86+
</dependency>
87+
<dependency>
88+
<groupId>org.springframework.boot</groupId>
89+
<artifactId>spring-boot-starter-mail-test</artifactId>
90+
<scope>test</scope>
91+
</dependency>
92+
<dependency>
93+
<groupId>org.springframework.boot</groupId>
94+
<artifactId>spring-boot-starter-security-test</artifactId>
95+
<scope>test</scope>
96+
</dependency>
97+
<dependency>
98+
<groupId>org.springframework.boot</groupId>
99+
<artifactId>spring-boot-starter-validation-test</artifactId>
100+
<scope>test</scope>
101+
</dependency>
102+
<dependency>
103+
<groupId>org.springframework.boot</groupId>
104+
<artifactId>spring-boot-starter-webclient-test</artifactId>
105+
<scope>test</scope>
106+
</dependency>
107+
<dependency>
108+
<groupId>org.springframework.boot</groupId>
109+
<artifactId>spring-boot-starter-webflux-test</artifactId>
110+
<scope>test</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.springframework.boot</groupId>
114+
<artifactId>spring-boot-starter-webmvc-test</artifactId>
115+
<scope>test</scope>
116+
</dependency>
117+
<dependency>
118+
<groupId>org.springframework.boot</groupId>
119+
<artifactId>spring-boot-starter-websocket-test</artifactId>
120+
<scope>test</scope>
121+
</dependency>
122+
<dependency>
123+
<groupId>org.springframework.boot</groupId>
124+
<artifactId>spring-boot-starter-restclient-test</artifactId>
125+
<scope>test</scope>
126+
</dependency>
63127
<dependency>
64128
<groupId>org.springframework.ai</groupId>
65129
<artifactId>spring-ai-starter-model-chat-memory</artifactId>
66130
</dependency>
67-
<dependency>
68-
<groupId>org.springframework.boot</groupId>
69-
<artifactId>spring-boot-starter-validation</artifactId>
70-
</dependency>
71131
<dependency>
72132
<groupId>org.springframework.ai</groupId>
73133
<artifactId>spring-ai-starter-model-ollama</artifactId>
74134
</dependency>
75135
<dependency>
76136
<groupId>org.springframework.ai</groupId>
77137
<artifactId>spring-ai-retry</artifactId>
78-
</dependency>
79-
<dependency>
80-
<groupId>io.micrometer</groupId>
81-
<artifactId>micrometer-registry-prometheus</artifactId>
82-
<scope>runtime</scope>
83-
</dependency>
84-
<dependency>
85-
<groupId>org.springframework.boot</groupId>
86-
<artifactId>spring-boot-starter-test</artifactId>
87-
<scope>test</scope>
88-
</dependency>
89-
<dependency>
90-
<groupId>io.projectreactor</groupId>
91-
<artifactId>reactor-test</artifactId>
92-
<scope>test</scope>
93-
</dependency>
94-
<dependency>
95-
<groupId>org.springframework.security</groupId>
96-
<artifactId>spring-security-test</artifactId>
97-
<scope>test</scope>
98-
</dependency>
138+
</dependency>
99139
<dependency>
100140
<groupId>net.javacrumbs.shedlock</groupId>
101141
<artifactId>shedlock-spring</artifactId>

backend/src/main/java/ch/xxx/messenger/adapter/config/GlobalErrorWebExceptionHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
package ch.xxx.messenger.adapter.config;
1414

1515
import org.springframework.boot.autoconfigure.web.WebProperties;
16-
import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler;
17-
import org.springframework.boot.web.reactive.error.ErrorAttributes;
16+
import org.springframework.boot.webflux.autoconfigure.error.AbstractErrorWebExceptionHandler;
17+
import org.springframework.boot.webflux.error.ErrorAttributes;
1818
import org.springframework.context.ApplicationContext;
1919
import org.springframework.core.annotation.Order;
2020
import org.springframework.http.HttpStatus;

backend/src/main/java/ch/xxx/messenger/adapter/config/SpringMongoConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.slf4j.Logger;
1616
import org.slf4j.LoggerFactory;
1717
import org.springframework.beans.factory.annotation.Value;
18-
import org.springframework.boot.autoconfigure.mongo.MongoProperties;
18+
import org.springframework.boot.mongodb.autoconfigure.MongoProperties;
1919
import org.springframework.context.annotation.Bean;
2020
import org.springframework.context.annotation.Configuration;
2121
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;

backend/src/main/java/ch/xxx/messenger/adapter/config/WebSecurityConfig.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,21 @@
1212
*/
1313
package ch.xxx.messenger.adapter.config;
1414

15-
import org.springframework.boot.autoconfigure.security.SecurityProperties;
1615
import org.springframework.context.annotation.Bean;
1716
import org.springframework.context.annotation.Configuration;
18-
import org.springframework.core.annotation.Order;
1917
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
2018
import org.springframework.security.config.http.SessionCreationPolicy;
2119
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
2220
import org.springframework.security.crypto.password.PasswordEncoder;
2321
import org.springframework.security.web.SecurityFilterChain;
2422
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
2523
import org.springframework.security.web.header.writers.XXssProtectionHeaderWriter.HeaderValue;
26-
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
24+
import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher;
2725

2826
import ch.xxx.messenger.domain.common.JwtTokenProvider;
2927
import ch.xxx.messenger.domain.common.Role;
3028

3129
@Configuration
32-
@Order(SecurityProperties.DEFAULT_FILTER_ORDER)
3330
public class WebSecurityConfig {
3431

3532
private final JwtTokenProvider jwtTokenProvider;
@@ -43,9 +40,9 @@ public SecurityFilterChain configure(HttpSecurity http) throws Exception {
4340
JwtTokenFilter customFilter = new JwtTokenFilter(jwtTokenProvider);
4441
HttpSecurity httpSecurity = http
4542
.authorizeHttpRequests(authorize -> authorize
46-
.requestMatchers(AntPathRequestMatcher.antMatcher("/rest/auth/**")).permitAll()
47-
.requestMatchers(AntPathRequestMatcher.antMatcher("/rest/**")).hasAuthority(Role.USERS.toString())
48-
.requestMatchers(AntPathRequestMatcher.antMatcher("/**")).permitAll())
43+
.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher("/rest/auth/**")).permitAll()
44+
.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher("/rest/**")).hasAuthority(Role.USERS.toString())
45+
.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher("/**")).permitAll())
4946
.csrf(myCsrf -> myCsrf.disable())
5047
.sessionManagement(mySm -> mySm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
5148
.headers(myHeaders -> myHeaders.contentSecurityPolicy(myCsp -> myCsp.policyDirectives(

backend/src/main/java/ch/xxx/messenger/domain/exception/MyErrorAttributes.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

backend/src/test/java/ch/xxx/messenger/adapter/controller/MessageControllerTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,14 @@
2727
import org.junit.jupiter.api.Test;
2828
import org.mockito.Mockito;
2929
import org.springframework.beans.factory.annotation.Autowired;
30-
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
30+
import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest;
3131
import org.springframework.context.annotation.ComponentScan.Filter;
3232
import org.springframework.context.annotation.FilterType;
3333
import org.springframework.http.MediaType;
3434
import org.springframework.test.context.bean.override.mockito.MockitoBean;
3535
import org.springframework.test.util.ReflectionTestUtils;
3636
import org.springframework.test.web.servlet.MockMvc;
3737

38-
import com.fasterxml.jackson.databind.ObjectMapper;
39-
4038
import ch.xxx.messenger.adapter.config.WebSecurityConfig;
4139
import ch.xxx.messenger.domain.common.JwtTokenProvider;
4240
import ch.xxx.messenger.domain.common.Role;
@@ -45,6 +43,7 @@
4543
import ch.xxx.messenger.domain.model.SyncMsgs;
4644
import ch.xxx.messenger.usecase.service.MessageService;
4745
import reactor.core.publisher.Flux;
46+
import tools.jackson.databind.json.JsonMapper;
4847

4948
@WebMvcTest(controllers = MessageController.class, includeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {
5049
WebSecurityConfig.class, JwtTokenProvider.class }))
@@ -57,7 +56,7 @@ public class MessageControllerTest {
5756
@Autowired
5857
private JwtTokenProvider jwtTokenProvider;
5958
@Autowired
60-
private ObjectMapper objectMapper;
59+
private JsonMapper objectMapper;
6160
@Autowired
6261
private MockMvc mockMvc;
6362

backend/src/test/java/ch/xxx/messenger/architecture/MyArchitectureTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import org.junit.jupiter.api.Test;
2424
import org.slf4j.Logger;
25-
import org.springframework.boot.web.reactive.error.DefaultErrorAttributes;
25+
import org.springframework.boot.webflux.error.DefaultErrorAttributes;
2626
import org.springframework.context.annotation.Configuration;
2727
import org.springframework.scheduling.annotation.Scheduled;
2828
import org.springframework.web.bind.annotation.RestController;

0 commit comments

Comments
 (0)