summaryrefslogtreecommitdiffstats
path: root/cps-application/src/main/java/org
diff options
context:
space:
mode:
authoregernug <gerard.nugent@est.tech>2023-09-21 17:51:21 +0100
committeregernug <gerard.nugent@est.tech>2023-09-22 11:20:05 +0100
commit477bd46874d2c8266007358f9ca335b0442cea18 (patch)
treeb5e4e88655f1d84eca7c6d14bd14962b1ad4e845 /cps-application/src/main/java/org
parent0af82141cb75a04a16248e17d4e915a580e82300 (diff)
Reinstate Spring Boot 3.0 after revert
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: Iee5c514ccdba36a387f83948d8a3ba26e6b1de5b
Diffstat (limited to 'cps-application/src/main/java/org')
-rw-r--r--cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java13
1 files changed, 5 insertions, 8 deletions
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();
}