JAVA-15688 Update fauna module under persistence-modules to remove usage of deprecated WebSecurityConfigurerAdapter (#13054)
* JAVA-15688 Update fauna module under persistence-modules to remove usage of deprecated WebSecurityConfigurerAdapter * JAVA-15688 Fix build issue
This commit is contained in:
parent
32e34e537b
commit
b0de3c6279
|
@ -8,27 +8,30 @@ import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||||
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
public class WebSecurityConfiguration {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FaunaClient faunaClient;
|
private FaunaClient faunaClient;
|
||||||
|
|
||||||
@Override
|
@Bean
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||||
http.csrf().disable();
|
http.csrf()
|
||||||
|
.disable();
|
||||||
http.authorizeRequests()
|
http.authorizeRequests()
|
||||||
.antMatchers("/**").permitAll()
|
.antMatchers("/**")
|
||||||
.and().httpBasic();
|
.permitAll()
|
||||||
|
.and()
|
||||||
|
.httpBasic();
|
||||||
|
return http.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Override
|
|
||||||
public UserDetailsService userDetailsService() {
|
public UserDetailsService userDetailsService() {
|
||||||
return new FaunaUserDetailsService(faunaClient);
|
return new FaunaUserDetailsService(faunaClient);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue