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
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;
@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();
}