summaryrefslogtreecommitdiffstats
path: root/runtime-acm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime-acm')
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/SecurityConfig.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/SecurityConfig.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/SecurityConfig.java
index 2e75db12e..9d50fc739 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/SecurityConfig.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/SecurityConfig.java
@@ -45,16 +45,16 @@ public class SecurityConfig {
*/
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
- http
- .httpBasic(Customizer.withDefaults())
- .authorizeHttpRequests(authorize -> {
- if (useBasicAuth) {
- authorize.anyRequest().authenticated();
- } else {
- authorize.anyRequest().permitAll();
- }
- })
- .csrf(AbstractHttpConfigurer::disable);
+ if (useBasicAuth) {
+ http
+ .httpBasic(Customizer.withDefaults())
+ .authorizeHttpRequests(authorize -> authorize.anyRequest().authenticated());
+ } else {
+ http
+ .authorizeHttpRequests(authorize -> authorize.anyRequest().permitAll());
+ }
+
+ http.csrf(AbstractHttpConfigurer::disable);
return http.build();
}
}