diff options
-rw-r--r-- | policyhandler/config.py | 6 | ||||
-rw-r--r-- | requirements.txt | 2 | ||||
-rw-r--r-- | setup.py | 4 |
3 files changed, 7 insertions, 5 deletions
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 @@ class PolicyEngineConfig(object): 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 @@ -29,10 +29,10 @@ setup( 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"
],
|