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:
anuragkumawat 2022-11-23 23:44:35 +05:30 committed by GitHub
parent 32e34e537b
commit b0de3c6279
1 changed files with 11 additions and 8 deletions

View File

@ -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.web.builders.HttpSecurity;
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.web.SecurityFilterChain;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
public class WebSecurityConfiguration {
@Autowired
private FaunaClient faunaClient;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf()
.disable();
http.authorizeRequests()
.antMatchers("/**").permitAll()
.and().httpBasic();
.antMatchers("/**")
.permitAll()
.and()
.httpBasic();
return http.build();
}
@Bean
@Override
public UserDetailsService userDetailsService() {
return new FaunaUserDetailsService(faunaClient);
}