From a0984e365a7c610e9cb91cf73e5d09db2be6df6a Mon Sep 17 00:00:00 2001 From: "stark, steven" Date: Thu, 15 Oct 2020 12:34:35 -0700 Subject: [VVP] VVP onap-client enhancements Adding capability for custom auth plugin (defaults to basic auth). During updates to VNF models, resource and policy objects are deletd and recreated. Issue-ID: VVP-477 Signed-off-by: stark, steven Change-Id: Iba743176167c2b1df185666b08cbd79c6a559c9e --- onap-client/onap_client/sdnc/client.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'onap-client/onap_client/sdnc/client.py') diff --git a/onap-client/onap_client/sdnc/client.py b/onap-client/onap_client/sdnc/client.py index 1ebd04a..03b338e 100644 --- a/onap-client/onap_client/sdnc/client.py +++ b/onap-client/onap_client/sdnc/client.py @@ -34,7 +34,9 @@ # limitations under the License. # # ============LICENSE_END============================================ +from frozendict import frozendict from onap_client.client.clients import Client +from onap_client.auth import auth_handler class SDNCClient(Client): @@ -45,3 +47,21 @@ class SDNCClient(Client): @property def catalog_resources(self): return {} + + @property + def sdnc_username(self): + """Username to authenticate to SDNC""" + return self.config.sdnc.SDNC_USERNAME + + @property + def sdnc_password(self): + """Password to authenticate to SDNC""" + return self.config.sdnc.SDNC_PASSWORD + + @property + def auth(self): + return auth_handler( + frozendict(self.config.sdnc.AUTH_PLUGIN) if self.config.sdnc.AUTH_PLUGIN else None, + self.sdnc_username, + self.sdnc_password, + ) -- cgit 1.2.3-korg