From 477bd46874d2c8266007358f9ca335b0442cea18 Mon Sep 17 00:00:00 2001 From: egernug Date: Thu, 21 Sep 2023 17:51:21 +0100 Subject: Reinstate Spring Boot 3.0 after revert Issue-ID: CPS-1789 Signed-off-by: egernug Change-Id: Iee5c514ccdba36a387f83948d8a3ba26e6b1de5b --- .../main/java/org/onap/cps/config/WebSecurityConfig.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'cps-application/src/main/java') diff --git a/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java b/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java index aedc6a8d66..9b726ba75d 100644 --- a/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java +++ b/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java @@ -39,9 +39,7 @@ import org.springframework.security.web.SecurityFilterChain; @Configuration @EnableWebSecurity public class WebSecurityConfig { - private static final String USER_ROLE = "USER"; - private final String username; private final String password; private final String[] permitUris; @@ -54,9 +52,9 @@ public class WebSecurityConfig { * @param password password */ public WebSecurityConfig( - @Autowired @Value("${security.permit-uri}") final String permitUris, - @Autowired @Value("${security.auth.username}") final String username, - @Autowired @Value("${security.auth.password}") final String password + @Autowired @Value("${permit-uri}") final String permitUris, + @Autowired @Value("${security.auth.username}") final String username, + @Autowired @Value("${security.auth.password}") final String password ) { super(); this.permitUris = permitUris.isEmpty() ? new String[] {"/v3/api-docs"} : permitUris.split("\\s{0,9},\\s{0,9}"); @@ -80,12 +78,11 @@ public class WebSecurityConfig { http .httpBasic() .and() - .authorizeRequests() - .antMatchers(permitUris).permitAll() + .authorizeHttpRequests() + .requestMatchers(permitUris).permitAll() .anyRequest().authenticated() .and() .csrf().disable(); - return http.build(); } -- cgit 1.2.3-korg