/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2021,2023 Nordix Foundation.
+ * Copyright (C) 2021,2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@Configuration
public class SecurityConfig {
- @Value("${metrics.security.disabled}")
- private boolean disableMetricsSecurity;
+ @Value("${basicAuth:true}")
+ private boolean useBasicAuth;
/**
* Return the configuration of how access to this module's REST end points is secured.
http
.httpBasic(Customizer.withDefaults())
.authorizeHttpRequests(authorize -> {
- if (disableMetricsSecurity) {
- authorize.requestMatchers("/prometheus").permitAll()
- .anyRequest().authenticated();
- } else {
+ if (useBasicAuth) {
authorize.anyRequest().authenticated();
+ } else {
+ authorize.anyRequest().permitAll();
}
})
.csrf(AbstractHttpConfigurer::disable);
ddl-auto: create
open-in-view: false
-metrics:
- security:
- disabled: true
-
server:
servlet:
context-path: /onap/policy/clamp/acm
protocol: http
sampler:
jaeger-remote:
- endpoint: http://jaeger:14250
\ No newline at end of file
+ endpoint: http://jaeger:14250
+
+basicAuth: false
\ No newline at end of file