[JAVA-31203] Upgraded spring-cloud-config to spring boot 3 (#15861)

This commit is contained in:
panos-kakos 2024-02-20 13:34:36 +02:00 committed by GitHub
parent a4b26ac450
commit c77c0deea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 11 deletions

View File

@ -10,9 +10,10 @@
<packaging>pom</packaging>
<parent>
<groupId>com.baeldung.spring.cloud</groupId>
<artifactId>spring-cloud-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-3</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-3</relativePath>
</parent>
<modules>
@ -35,7 +36,7 @@
</dependencyManagement>
<properties>
<spring-cloud-dependencies.version>2021.0.3</spring-cloud-dependencies.version>
<spring-cloud-dependencies.version>2022.0.3</spring-cloud-dependencies.version>
</properties>
</project>

View File

@ -2,6 +2,7 @@ package com.baeldung.spring.cloud.config.server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.SecurityFilterChain;
@ -10,13 +11,13 @@ public class SecurityConfiguration {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf()
.ignoringAntMatchers("/encrypt/**")
.ignoringAntMatchers("/decrypt/**");
http.authorizeRequests((requests) -> requests.anyRequest()
.authenticated());
http.formLogin();
http.httpBasic();
http.csrf(csrf -> csrf.ignoringRequestMatchers(
"/encrypt/**", "/decrypt/**"
))
.authorizeRequests(authz -> authz.anyRequest().authenticated())
.formLogin(Customizer.withDefaults())
.httpBasic(Customizer.withDefaults());
return http.build();
}
}