diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2023-11-02 16:17:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-11-02 16:17:37 +0000 |
commit | ad6dfda45cecb80b8bc56be2325aa8697313dd98 (patch) | |
tree | 3eaf90c5a3db739ea1589fde909b7de08d6ca717 /src | |
parent | dc42c7165ed426fd0537495134480a7f91afbe1c (diff) | |
parent | 9a6f9215df1426a230137e829e14a1139533d66b (diff) |
Merge "Sonar Fixes"
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/config/DmiConfiguration.java | 1 | ||||
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java | 15 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/config/DmiConfiguration.java b/src/main/java/org/onap/cps/ncmp/dmi/config/DmiConfiguration.java index 18b22dbe..83ef6f89 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/config/DmiConfiguration.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/config/DmiConfiguration.java @@ -81,7 +81,6 @@ public class DmiConfiguration { private void setCustomRequestFactoryToSupportPatch(final RestTemplate restTemplate) { final HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); requestFactory.setConnectTimeout(TIMEOUT); - requestFactory.setReadTimeout(TIMEOUT); restTemplate.setRequestFactory(requestFactory); } }
\ No newline at end of file diff --git a/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java b/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java index 11d2ae53..ac92cb4a 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java @@ -20,14 +20,13 @@ package org.onap.cps.ncmp.dmi.config; -import static org.springframework.security.config.Customizer.withDefaults; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; 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.configurers.AbstractHttpConfigurer; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.provisioning.InMemoryUserDetailsManager; @@ -79,12 +78,12 @@ public class WebSecurityConfig { @SuppressWarnings("squid:S4502") public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception { http - .httpBasic(withDefaults()) - .authorizeRequests() - .requestMatchers(permitUris).permitAll() - .anyRequest().authenticated() - .and() - .csrf((csrf) -> csrf.disable()); + .httpBasic(httpBasicCustomizer -> {}) + .authorizeHttpRequests(authorizeHttpRequestsCustomizer -> { + authorizeHttpRequestsCustomizer.requestMatchers(permitUris).permitAll(); + authorizeHttpRequestsCustomizer.anyRequest().authenticated(); + }) + .csrf(AbstractHttpConfigurer::disable); return http.build(); } |