Update Policy config url and pass 22/97722/1
authorRuoyu Ying <ruoyu.ying@intel.com>
Wed, 30 Oct 2019 15:25:55 +0000 (23:25 +0800)
committerRuoyu Ying <ruoyu.ying@intel.com>
Wed, 30 Oct 2019 15:30:40 +0000 (23:30 +0800)
Update the config retrieval uri and authorization keys

Issue-ID: OPTFRA-520
Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
Change-Id: I694930fcbf2ac2b17c048d0341571a027552576c

config/osdf_config.yaml
config/preload_secrets.yaml
osdf/adapters/policy/interface.py

index cf5426b..7ae8cac 100755 (executable)
@@ -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/
index 1d2ea01..3050d87 100755 (executable)
@@ -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
index 7c3118c..61861de 100644 (file)
@@ -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)