fixed ClientAuth and Authorization parsing

two formats of ClientAuth and Authorization
* Basic <auth>
* <auth>

Change-Id: I177a86caef6b2a2406277413d5de1972bcf19cfe
Issue-Id: DCAEGEN2-128
Signed-off-by: Alex Shatov <alexs@att.com>
diff --git a/policyhandler/config.py b/policyhandler/config.py
index 81eaccb..5c7e962 100644
--- a/policyhandler/config.py
+++ b/policyhandler/config.py
@@ -22,6 +22,7 @@
 import os
 import json
 import copy
+import re
 import base64
 import logging
 import logging.config
@@ -141,8 +142,9 @@
         try:
             config = Config.config[Config.FIELD_POLICY_ENGINE]
             headers = config["headers"]
-            client_parts = base64.b64decode(headers["ClientAuth"].split()[1]).split(":")
-            auth_parts = base64.b64decode(headers["Authorization"].split()[1]).split(":")
+            remove_basic = re.compile(r"(^Basic )")
+            client_parts = base64.b64decode(remove_basic.sub("", headers["ClientAuth"])).split(":")
+            auth_parts = base64.b64decode(remove_basic.sub("", headers["Authorization"])).split(":")
 
             props = PolicyEngineConfig.PYPDP_URL.format(config["url"], config["path_pdp"],
                                                         auth_parts[0], auth_parts[1])
diff --git a/requirements.txt b/requirements.txt
index 43e8bf7..8afa983 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-CherryPy>=10.2.2
+CherryPy>=10.2.2,<11.0
 enum34>=1.1.6
 future>=0.16.0
 requests>=2.13.0,<3.0.0
diff --git a/setup.py b/setup.py
index d39a1c2..85e74ba 100644
--- a/setup.py
+++ b/setup.py
@@ -29,10 +29,10 @@
     packages=['policyhandler'],

     zip_safe=False,

     install_requires=[

-        "CherryPy>=10.2.2",

+        "CherryPy>=10.2.2,<11.0",

         "enum34>=1.1.6",

         "future>=0.16.0",

-        "requests>=2.13.0",

+        "requests>=2.13.0,<3.0.0",

         "six>=1.10.0",

         "websocket-client>=0.40.0"

     ],