Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docusign_esign/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def __call_api(self, resource_path, method,
_request_timeout=None):
"""
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without
reading/decoding response data. Default is True.
:return:
reading/decoding response data. Default is True.
:return:
"""

# header parameters
Expand Down Expand Up @@ -686,7 +686,7 @@ def request_jwt_user_token(self, client_id, user_id, oauth_host_name, private_ke
later = now + (expires_in * 1)
claim = {"iss": client_id, "sub": user_id, "aud": oauth_host_name, "iat": now, "exp": later,
"scope": " ".join(scopes)}
token = jwt.encode(payload=claim, key=private_key_bytes, algorithm='RS256').decode("utf-8")
token = jwt.encode(payload=claim, key=private_key_bytes, algorithm='RS256')
response = self.request("POST", "https://" + oauth_host_name + "/oauth/token",
headers=self.sanitize_for_serialization(
{"Content-Type": "application/x-www-form-urlencoded"}),
Expand Down Expand Up @@ -818,8 +818,8 @@ def set_oauth_host_name(self, oauth_host_name=None):
def set_access_token(self, token_obj):
"""

:param token_obj:
:return:
:param token_obj:
:return:
"""
self.default_headers['Authorization'] = token_obj.access_token

Expand Down
29 changes: 21 additions & 8 deletions docusign_esign/client/api_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import re
import json
import logging
import os

from six import PY3
from six.moves.urllib.parse import urlencode
Expand Down Expand Up @@ -81,14 +82,26 @@ def __init__(self, pools_size=4, maxsize=4):
key_file = Configuration().key_file

# https pool manager
self.pool_manager = urllib3.PoolManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=cert_file,
key_file=key_file
)
proxy_url = os.environ.get("HTTPS_PROXY", os.environ.get("HTTP_PROXY"))
if proxy_url is None:
self.pool_manager = urllib3.PoolManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=cert_file,
key_file=key_file
)
else:
self.pool_manager = urllib3.ProxyManager(
proxy_url=proxy_url,
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=cert_file,
key_file=key_file
)

def request(self, method, url, query_params=None, headers=None,
body=None, post_params=None, _preload_content=True, _request_timeout=None):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ six >= 1.8.0
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15
PyJWT>=1.7.1,<2
PyJWT==2.3.0
cryptography>=2.5
nose>=1.3.7
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""


from setuptools import setup, find_packages, Command, os # noqa: H301
from setuptools import setup, find_packages, Command, os # noqa: H301

NAME = "docusign-esign"
VERSION = "3.14.0"
Expand All @@ -22,7 +22,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools

REQUIRES = ["urllib3 >= 1.15", "six >= 1.8.0", "certifi >= 14.05.14", "python-dateutil >= 2.5.3", "setuptools >= 21.0.0", "PyJWT>=1.7.1,<2", "cryptography>=2.5", "nose>=1.3.7"]
REQUIRES = ["urllib3 >= 1.15", "six >= 1.8.0", "certifi >= 14.05.14", "python-dateutil >= 2.5.3", "setuptools >= 21.0.0", "PyJWT==2.3.0", "cryptography>=2.5", "nose>=1.3.7"]

class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
Expand All @@ -37,7 +37,7 @@ def run(self):
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()


setup(
name=NAME,
Expand Down