From eea1300171509e7f5c6aa5e9e01f88a7afa24d0b Mon Sep 17 00:00:00 2001 From: Ruoyu Ying Date: Wed, 30 Oct 2019 23:25:55 +0800 Subject: Update Policy config url and pass Update the config retrieval uri and authorization keys Issue-ID: OPTFRA-520 Signed-off-by: Ruoyu Ying Change-Id: I694930fcbf2ac2b17c048d0341571a027552576c --- config/osdf_config.yaml | 5 ++--- config/preload_secrets.yaml | 8 ++------ osdf/adapters/policy/interface.py | 5 +---- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/config/osdf_config.yaml b/config/osdf_config.yaml index cf5426b..7ae8cac 100755 --- a/config/osdf_config.yaml +++ b/config/osdf_config.yaml @@ -17,9 +17,8 @@ conductorMaxRetries: 30 # if we don't get something in 30 minutes, give up # versions to be set in HTTP header conductorMinorVersion: 0 -# Policy Platform -- requires ClientAuth, Authorization, and Environment -policyPlatformUrl: http://policy.api.simpledemo.onap.org:8081/pdp/api/getConfig # Policy Dev platform URL -policyPlatformEnv: TEST # Environment for policy platform +# Policy Platform -- requires Authorization +policyPlatformUrl: https://policy-xacml-pdp:6969/policy/pdpx/decision/v1 # Policy Dev platform URL # URL for policy model uploading policyPlatformUrlModelUpload: https://policy.api.simpledemo.onap.org:8081/policy/api/v1/policytypes pathPolicyModelUpload: ../../models/policy/placement/tosca_upload/ diff --git a/config/preload_secrets.yaml b/config/preload_secrets.yaml index 1d2ea01..3050d87 100755 --- a/config/preload_secrets.yaml +++ b/config/preload_secrets.yaml @@ -11,12 +11,8 @@ secrets: Password: plan.15 - name: policyPlatform values: - UserName: testpdp - Password: alpha123 -- name: policyClient - values: - UserName: python - Password: test + UserName: healthcheck + Password: zb!XztG34 - name: dmaap values: UserName: NA diff --git a/osdf/adapters/policy/interface.py b/osdf/adapters/policy/interface.py index 7c3118c..61861de 100644 --- a/osdf/adapters/policy/interface.py +++ b/osdf/adapters/policy/interface.py @@ -128,11 +128,8 @@ def remote_api(req_json, osdf_config, service_type="placement"): """ config = osdf_config.deployment uid, passwd = config['policyPlatformUsername'], config['policyPlatformPassword'] - pcuid, pcpasswd = config['policyClientUsername'], config['policyClientPassword'] - headers = {"ClientAuth": base64.b64encode(bytes("{}:{}".format(pcuid, pcpasswd), "ascii"))} - headers.update({'Environment': config['policyPlatformEnv']}) url = config['policyPlatformUrl'] - rc = RestClient(userid=uid, passwd=passwd, headers=headers, url=url, log_func=debug_log.debug) + rc = RestClient(userid=uid, passwd=passwd, url=url, log_func=debug_log.debug) if osdf_config.core['policy_info'][service_type]['policy_fetch'] == "by_name": policies = get_by_name(rc, req_json[service_type + "Info"]['policyId'], wildcards=True) -- cgit 1.2.3-korg