Skip to content

Commit f0fd722

Browse files
committed
Merge remote-tracking branch 'origin/v2' into v2
2 parents fe073bf + 5c1d01a commit f0fd722

19 files changed

+134
-809
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@
5151
'pycryptodome==3.9.7',
5252
'ldap3',
5353
'PyYAML',
54-
'six',
5554
'umapi-client==2.19',
5655
'click',
5756
'click-default-group',
5857
'configparser==3.7.4',
5958
'schema==0.7.2',
60-
'sign-client'
59+
'sign-client~=0.2.1',
6160
],
6261
extras_require={
6362
':sys_platform=="linux" or sys_platform=="linux2"': [

sign_client/poetry.lock

Lines changed: 0 additions & 690 deletions
This file was deleted.

sign_client/pyproject.toml

Lines changed: 0 additions & 32 deletions
This file was deleted.

sign_client/setup.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright (c) 2016-2017 Adobe Inc. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
# SOFTWARE.
20+
21+
from setuptools import setup, find_packages
22+
23+
version_namespace = {}
24+
with open('sign_client/version.py') as f:
25+
exec(f.read(), version_namespace)
26+
27+
setup(name='sign-client',
28+
version=version_namespace['__version__'],
29+
description='Client for the Adobe Sign API',
30+
classifiers=[
31+
'Programming Language :: Python :: 3.7',
32+
'Programming Language :: Python :: 3.8',
33+
'Programming Language :: Python :: 3.9',
34+
'Programming Language :: Python :: 3.10',
35+
'License :: OSI Approved :: MIT License',
36+
],
37+
maintainer='Andrew Dorton',
38+
maintainer_email='[email protected]',
39+
license='MIT',
40+
packages=find_packages(),
41+
install_requires=[
42+
"requests~=2.26.0",
43+
"aiohttp~=3.8.1",
44+
],
45+
zip_safe=False)

sign_client/sign_client/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import aiohttp
77
import requests
88

9+
from aiohttp.client_exceptions import ServerTimeoutError
10+
911
from .error import AssertionException, TimeoutException
1012

1113
from .model import GroupInfo, UsersInfo, DetailedUserInfo, GroupsInfo, UserGroupsInfo, JSONEncoder, DetailedGroupInfo, UserStateInfo
@@ -343,7 +345,7 @@ async def call_with_retry_async(self, method, url, header, data=None, session=No
343345
else:
344346
# PUT calls respond with an empty body
345347
return body, r.status
346-
except TimeoutException as err:
348+
except (TimeoutException, ServerTimeoutError) as err:
347349
retry_nb += 1
348350
self.logger.warning('Call failed: Type: {} - Message: {}'.format(type(err), err))
349351
if retry_nb == (self.max_sign_retries + 1):

sign_client/sign_client/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.2.1'

user_sync/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,12 @@ def begin_work_umapi(config_loader: UMAPIConfigLoader):
355355
# make sure that all the adobe groups are from known umapi connector names
356356
primary_umapi_config, secondary_umapi_configs = config_loader.get_target_options()
357357
referenced_umapi_names = set()
358-
for groups in six.itervalues(directory_groups):
358+
for groups in directory_groups.values():
359359
for group in groups:
360360
umapi_name = group.umapi_name
361361
if umapi_name != PRIMARY_TARGET_NAME:
362362
referenced_umapi_names.add(umapi_name)
363-
referenced_umapi_names.difference_update(six.iterkeys(secondary_umapi_configs))
363+
referenced_umapi_names.difference_update(secondary_umapi_configs.keys())
364364
if len(referenced_umapi_names) > 0:
365365
raise AssertionException('Adobe groups reference unknown umapi connectors: %s' % referenced_umapi_names)
366366

@@ -380,7 +380,7 @@ def begin_work_umapi(config_loader: UMAPIConfigLoader):
380380
primary_name = '.primary' if secondary_umapi_configs else ''
381381
umapi_primary_connector = UmapiConnector(primary_name, primary_umapi_config, True)
382382
umapi_other_connectors = {}
383-
for secondary_umapi_name, secondary_config in six.iteritems(secondary_umapi_configs):
383+
for secondary_umapi_name, secondary_config in secondary_umapi_configs.items():
384384
umapi_secondary_conector = UmapiConnector(".secondary.%s" % secondary_umapi_name,
385385
secondary_config)
386386
umapi_other_connectors[secondary_umapi_name] = umapi_secondary_conector
@@ -646,7 +646,7 @@ def log_parameters(argv, config_loader):
646646
logger.info('------- Command line arguments -------')
647647
logger.info(' '.join(argv))
648648
logger.debug('-------- Resulting invocation options --------')
649-
for parameter_name, parameter_value in six.iteritems(config_loader.get_invocation_options()):
649+
for parameter_name, parameter_value in config_loader.get_invocation_options().items():
650650
logger.debug(' %s: %s', parameter_name, parameter_value)
651651
logger.info('-------------------------------------')
652652

user_sync/certgen.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ def create_key():
5656
def create_cert(subject_fields, key):
5757
try:
5858
subject = issuer = x509.Name([
59-
x509.NameAttribute(NameOID.COUNTRY_NAME, six.text_type(subject_fields['countryName'])),
59+
x509.NameAttribute(NameOID.COUNTRY_NAME, str(subject_fields['countryName'])),
6060
x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME,
61-
six.text_type(subject_fields['stateOrProvinceName'])),
62-
x509.NameAttribute(NameOID.LOCALITY_NAME, six.text_type(subject_fields['localityName'])),
63-
x509.NameAttribute(NameOID.ORGANIZATION_NAME, six.text_type(subject_fields['organizationName'])),
64-
x509.NameAttribute(NameOID.COMMON_NAME, six.text_type(subject_fields['commonName'])),
65-
x509.NameAttribute(NameOID.EMAIL_ADDRESS, six.text_type(subject_fields['emailAddress']))
61+
str(subject_fields['stateOrProvinceName'])),
62+
x509.NameAttribute(NameOID.LOCALITY_NAME, str(subject_fields['localityName'])),
63+
x509.NameAttribute(NameOID.ORGANIZATION_NAME, str(subject_fields['organizationName'])),
64+
x509.NameAttribute(NameOID.COMMON_NAME, str(subject_fields['commonName'])),
65+
x509.NameAttribute(NameOID.EMAIL_ADDRESS, str(subject_fields['emailAddress']))
6666
])
6767

6868
return x509.CertificateBuilder().subject_name(

user_sync/config/common.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33

44
import re
5-
import six
5+
# import six
66
import yaml
77
from abc import ABC, abstractmethod
88

@@ -72,7 +72,7 @@ def iter_configs(self):
7272
:rtype iterable(ObjectConfig)
7373
"""
7474
yield self
75-
for child_config in six.itervalues(self.child_configs):
75+
for child_config in self.child_configs.values():
7676
for subtree_config in child_config.iter_configs():
7777
yield subtree_config
7878

@@ -88,7 +88,7 @@ def create_assertion_error(self, message):
8888
return AssertionException("%s in: %s" % (message, self.get_full_scope()))
8989

9090
def describe_types(self, types_to_describe):
91-
if types_to_describe == six.string_types:
91+
if types_to_describe == str:
9292
result = self.describe_types(str)
9393
elif isinstance(types_to_describe, tuple):
9494
result = []
@@ -166,7 +166,7 @@ def __contains__(self, item):
166166
return item in self.value
167167

168168
def iter_keys(self):
169-
return six.iterkeys(self.value)
169+
return self.value.keys()
170170

171171
def iter_unused_keys(self):
172172
for key in self.iter_keys():
@@ -196,7 +196,7 @@ def get_string(self, key, none_allowed=False) -> str:
196196
"""
197197
:rtype: basestring
198198
"""
199-
return self.get_value(key, six.string_types, none_allowed)
199+
return self.get_value(key, str, none_allowed)
200200

201201
def get_int(self, key, none_allowed=False):
202202
"""
@@ -393,7 +393,7 @@ def load_from_yaml(self, filepath, path_keys):
393393
if not isinstance(yml, dict):
394394
# malformed YML files produce a non-dictionary
395395
raise AssertionException("Configuration file or command '{}' does not contain settings".format(filepath))
396-
for path_key, options in six.iteritems(path_keys):
396+
for path_key, options in path_keys.items():
397397
key_path = path_key
398398
keys = path_key.split('/')
399399
self.process_path_key(dirpath, filename, key_path, yml, keys, 1, *options)
@@ -419,7 +419,7 @@ def process_path_key(self, dirpath, filename, key_path, dictionary, keys, level,
419419
# if a wildcard is specified at this level, that means we
420420
# should process all keys as path values
421421
if key == "*":
422-
for key, val in six.iteritems(dictionary):
422+
for key, val in dictionary.items():
423423
dictionary[key] = self.process_path_value(dirpath, filename, key_path, val, must_exist, can_have_subdict)
424424
elif key in dictionary:
425425
dictionary[key] = self.process_path_value(dirpath, filename, key_path, dictionary[key], must_exist, can_have_subdict)
@@ -451,13 +451,13 @@ def process_path_value(self, dirpath, filename, key_path, val, must_exist, can_h
451451
:param must_exist: whether there must be a value
452452
:param can_have_subdict: whether the value can be a tagged string
453453
"""
454-
if isinstance(val, six.string_types):
454+
if isinstance(val, str):
455455
return self.relative_path(dirpath, filename, key_path, val, must_exist)
456456
elif isinstance(val, list):
457457
vals = []
458458
for entry in val:
459459
if can_have_subdict and isinstance(entry, dict):
460-
for subkey, subval in six.iteritems(entry):
460+
for subkey, subval in entry.items():
461461
vals.append({subkey: self.relative_path(dirpath, filename, key_path, subval, must_exist)})
462462
else:
463463
vals.append(self.relative_path(dirpath, filename, key_path, entry, must_exist))
@@ -468,7 +468,7 @@ def relative_path(dirpath, filename, key_path, val, must_exist):
468468
"""
469469
returns an absolute path that is resolved relative to the file being loaded
470470
"""
471-
if not isinstance(val, six.string_types):
471+
if not isinstance(val, str):
472472
raise AssertionException("Expected pathname for setting {} in config file {}".format(key_path, filename))
473473
if val.startswith('$(') and val.endswith(')'):
474474
raise AssertionException("Shell execution is no longer supported: {}".format(val))
@@ -509,7 +509,7 @@ def set_string_value(self, key, default_value):
509509
:type key: str
510510
:type default_value: Optional(str)
511511
"""
512-
self.set_value(key, six.string_types, default_value)
512+
self.set_value(key, str, default_value)
513513

514514
def set_dict_value(self, key, default_value):
515515
"""
@@ -526,7 +526,7 @@ def set_value(self, key, allowed_types, default_value):
526526
self.options[key] = value
527527

528528
def require_string_value(self, key):
529-
return self.require_value(key, six.string_types)
529+
return self.require_value(key, str)
530530

531531
def require_value(self, key, allowed_types):
532532
config = self.default_config
@@ -539,7 +539,7 @@ def require_value(self, key, allowed_types):
539539
def resolve_invocation_options(options: dict, invocation_config: DictConfig, invocation_defaults: dict, args: dict) -> dict:
540540
# get overrides from the main config
541541
if invocation_config:
542-
for k, v in six.iteritems(invocation_defaults):
542+
for k, v in invocation_defaults.items():
543543
if isinstance(v, bool):
544544
val = invocation_config.get_bool(k, True)
545545
if val is not None:

user_sync/config/sign_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def get_engine_options(self) -> dict:
233233
sign_only_user_action = user_sync.get_value('sign_only_user_action', (str, int))
234234
options['user_sync']['sign_only_user_action'] = sign_only_user_action
235235
if options.get('directory_group_mapped'):
236-
options['directory_group_filter'] = set(six.iterkeys(self.directory_groups))
236+
options['directory_group_filter'] = set(self.directory_groups.keys())
237237
options['cache'] = self.main_config.get_dict('cache')
238238
return options
239239

0 commit comments

Comments
 (0)