[JAVA-27826] Upgraded to spring boot 3 (#15745)
This commit is contained in:
parent
cc70defdc5
commit
003170eb0d
|
@ -10,9 +10,9 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<artifactId>parent-boot-3</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-boot-2</relativePath>
|
||||
<relativePath>../../parent-boot-3</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@ -156,14 +156,11 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<jmeter-maven-plugin.version>3.7.0</jmeter-maven-plugin.version>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
<start-class>com.baeldung.dashboard.DashboardApplication</start-class>
|
||||
<jmeter-maven-plugin.version>3.7.0</jmeter-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.baeldung.configuration;
|
||||
|
||||
import static org.springframework.security.config.Customizer.withDefaults;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -12,6 +14,7 @@ import org.springframework.security.crypto.factory.PasswordEncoderFactories;
|
|||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
|
||||
@Configuration
|
||||
public class WebSecurityConfiguration {
|
||||
|
@ -30,15 +33,17 @@ public class WebSecurityConfiguration {
|
|||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilter(HttpSecurity http) throws Exception {
|
||||
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests()
|
||||
.antMatchers("/secured/**").authenticated()
|
||||
.anyRequest().permitAll()
|
||||
.and()
|
||||
.httpBasic();
|
||||
.authorizeHttpRequests(authorizeRequests ->
|
||||
authorizeRequests
|
||||
.requestMatchers(new AntPathRequestMatcher("/secured/**"))
|
||||
.authenticated()
|
||||
.anyRequest().permitAll()
|
||||
)
|
||||
.httpBasic(withDefaults());
|
||||
|
||||
return http.build();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.baeldung.domain;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
|
|
Loading…
Reference in New Issue