diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2023-08-01 15:36:27 +0100 |
---|---|---|
committer | Priyank Maheshwari <priyank.maheshwari@est.tech> | 2023-08-04 09:04:40 +0000 |
commit | 612fb579067ea79d0148462a45eeff737a58503f (patch) | |
tree | 9fbb678ca8a76c357aa141cb4fa8f3371233c475 /cps-ncmp-service/src/main/java/org | |
parent | 5c03520a3709ea215e1e6c4c77dd962864dda4af (diff) |
Ability to disable sending auth header
- introduced configurable parameter to disable sending auth header in
the request to dmi-plugin
- default is to include the auth header
- DMI_AUTH_ENABLED flag can be set to true/false to control the
behaviour
- Also added the env variables to the CSITs
- updated release-notes
Issue-ID: CPS-1819
Change-Id: If97c06e33f06e391d2190b7300d73210ed2f4e27
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main/java/org')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java | 4 | ||||
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java index 136935ba53..28e09ac4bc 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java @@ -61,7 +61,9 @@ public class DmiRestClient { } private HttpHeaders configureHttpHeaders(final HttpHeaders httpHeaders) { - httpHeaders.setBasicAuth(dmiProperties.getAuthUsername(), dmiProperties.getAuthPassword()); + if (dmiProperties.isDmiBasicAuthEnabled()) { + httpHeaders.setBasicAuth(dmiProperties.getAuthUsername(), dmiProperties.getAuthPassword()); + } httpHeaders.setContentType(MediaType.APPLICATION_JSON); return httpHeaders; } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java index 6decaf8444..ffecf9c7f1 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/NcmpConfiguration.java @@ -52,6 +52,8 @@ public class NcmpConfiguration { private String authPassword; @Value("${ncmp.dmi.api.base-path}") private String dmiBasePath; + @Value("${ncmp.dmi.auth.enabled}") + private boolean dmiBasicAuthEnabled; } /** |