Skip to content

Commit 6be9fac

Browse files
authored
Fix Spring Security deprecations after Spring Boot 3.3.8 upgrade (#740)
1 parent 40f55de commit 6be9fac

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
1414
- Improve switch statements after Java 17 migration. (#729)
1515
- Remove redundant blockchain calls to diminish pressure on Ethereum JSON-RPC API. (#734)
1616
- Compute alive workers metrics in `WorkerService#updateMetrics` scheduled job. (#739)
17+
- Fix Spring Security deprecations after Spring Boot 3.3.8 upgrade. (#740)
1718

1819
### Breaking API changes
1920

src/main/java/com/iexec/core/security/WebSecurityConfig.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.springframework.context.annotation.Configuration;
2121
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
2222
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
23+
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
2324
import org.springframework.security.config.http.SessionCreationPolicy;
2425
import org.springframework.security.web.SecurityFilterChain;
2526

@@ -30,13 +31,10 @@ public class WebSecurityConfig {
3031
@Bean
3132
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
3233
// Disable CSRF (cross site request forgery)
33-
http.csrf().disable();
34-
34+
http.csrf(AbstractHttpConfigurer::disable);
3535
// No session will be created or used by spring security
36-
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
37-
38-
http.authorizeHttpRequests()
39-
.anyRequest().permitAll();
36+
http.sessionManagement(sessionMgt -> sessionMgt.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
37+
http.authorizeHttpRequests(request -> request.anyRequest().permitAll());
4038
return http.build();
4139
}
4240
}

0 commit comments

Comments
 (0)