Skip to content

Commit 491cd5f

Browse files
committed
Merge branch 'v2'
2 parents f10741f + 0d88ca5 commit 491cd5f

File tree

7 files changed

+64
-76
lines changed

7 files changed

+64
-76
lines changed

.changelog/changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
| tag | date | title |
2+
|---|---|---|
3+
| v2.6.5 | 2021-09-14 | User Sync Tool v2.6.5 |
4+
5+
# Bug Fixes
6+
7+
\#728 - Fix keyring misidentification issue
8+
9+
# Build Information
10+
11+
Builds are now made with Python 3.9 on all platforms
12+
13+
---
14+
115
| tag | date | title |
216
|---|---|---|
317
| v2.6.4 | 2021-08-31 | User Sync Tool v2.6.4 |

.changelog/latest.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Bug Fixes
22

3-
\#723 - Start/end sync signals
4-
\#700 - Fix some issues with SSL verification
5-
\#623 - Fix Adobe-only list with post-sync
3+
\#728 - Fix keyring misidentification issue
64

7-
# Misc
5+
# Build Information
86

9-
\#591 - Document Two-Step Lookup
10-
\#676 - Introduce Changelog
7+
Builds are now made with Python 3.9 on all platforms

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Python
2222
uses: actions/setup-python@v2
2323
with:
24-
python-version: '3.6'
24+
python-version: '3.9'
2525
- name: Ubuntu
2626
if: matrix.os == 'ubuntu-latest'
2727
run: |

.github/workflows/package-release.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Python
2121
uses: actions/setup-python@v2
2222
with:
23-
python-version: '3.6'
23+
python-version: '3.9'
2424
- name: Get version tag
2525
id: get_version
2626
uses: battila7/get-version-action@v2
@@ -45,7 +45,7 @@ jobs:
4545
- name: Get build
4646
run: |
4747
cd dist
48-
tar czf "user-sync-$UST_VERSION $UST_VARIANT_TAG-ubuntu.tar.gz" user-sync
48+
tar czf "user-sync-${UST_VERSION}${UST_VARIANT_TAG}-ubuntu.tar.gz" user-sync
4949
env:
5050
UST_VARIANT_TAG: ${{matrix.variant_tag}}
5151
UST_VERSION: ${{ steps.get_version.outputs.version }}
@@ -70,7 +70,7 @@ jobs:
7070
- uses: actions/checkout@v2
7171
- uses: actions/setup-python@v2
7272
with:
73-
python-version: '3.6'
73+
python-version: '3.9'
7474
- name: Get version tag
7575
id: get_version
7676
uses: battila7/get-version-action@v2
@@ -117,24 +117,28 @@ jobs:
117117
uses: battila7/get-version-action@v2
118118
- name: Centos-Install dependencies
119119
run: |
120-
yum install -y epel-release
121-
yum install -y https://repo.ius.io/ius-release-el7.rpm
122-
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
123-
yum install -y gcc make python36u-devel python36u-pip python36u-virtualenv
124-
yum install -y python-devel python-pip python-virtualenv
125-
yum install -y pkgconfig openssl-devel dbus-glib-devel dbus-python libffi-devel
126-
rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python
127-
- name: Make Standalone
120+
yum install -y pkgconfig gcc openssl-devel dbus-glib-devel dbus-python libffi-devel wget
121+
mkdir tmp && cd tmp
122+
wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz
123+
tar xzf Python-3.9.7.tgz
124+
cd Python-3.9.7
125+
./configure --enable-optimizations --enable-shared
126+
make altinstall
127+
cd ../..
128+
- name: Build executable
128129
run: |
129-
pip3 install external/okta-0.0.3.1-py2.py3-none-any.whl
130-
pip3 install -e .
131-
pip3 install -e .[test]
132-
pip3 install -e .[setup]
133-
make standalone
130+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
131+
/usr/local/bin/python3.9 -m venv venv
132+
source venv/bin/activate
133+
python -m pip install --upgrade pip pyinstaller setuptools
134+
pip install external/okta-0.0.3.1-py2.py3-none-any.whl
135+
pip install -e .
136+
pip install -e .[test]
137+
pip install -e .[setup]
138+
make
139+
deactivate
134140
env:
135141
UST_EXTENSION: ${{matrix.extension_support}}
136-
- name: Test with pytest
137-
run: pytest -s
138142
- name: Get build
139143
run: |
140144
cd dist

user_sync/config.py

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
import user_sync.helper
3131
import user_sync.identity_type
32-
import user_sync.port
3332
import user_sync.rules
3433
from user_sync import flags
3534
from user_sync.error import AssertionException
@@ -282,7 +281,7 @@ def get_umapi_options(self):
282281
secondary_config_sources = {}
283282
primary_config_sources = []
284283
for item in umapi_config:
285-
if isinstance(item, six.string_types):
284+
if isinstance(item, str):
286285
if secondary_config_sources:
287286
# if we see a string after a dict, the user has done something wrong, and we fail.
288287
raise AssertionException("Secondary umapi configuration found with no prefix: " + item)
@@ -431,7 +430,7 @@ def get_post_sync_options(self):
431430
def as_list(value):
432431
if value is None:
433432
return []
434-
elif isinstance(value, user_sync.port.list_type):
433+
elif isinstance(value, list):
435434
return value
436435
return [value]
437436

@@ -657,8 +656,8 @@ def create_assertion_error(self, message):
657656
return AssertionException("%s in: %s" % (message, self.get_full_scope()))
658657

659658
def describe_types(self, types_to_describe):
660-
if types_to_describe == six.string_types:
661-
result = self.describe_types(user_sync.port.string_type)
659+
if types_to_describe == str:
660+
result = self.describe_types(str)
662661
elif isinstance(types_to_describe, tuple):
663662
result = []
664663
for type_to_describe in types_to_describe:
@@ -765,19 +764,19 @@ def get_string(self, key, none_allowed=False):
765764
"""
766765
:rtype: basestring
767766
"""
768-
return self.get_value(key, six.string_types, none_allowed)
767+
return self.get_value(key, str, none_allowed)
769768

770769
def get_int(self, key, none_allowed=False):
771770
"""
772771
:rtype: int
773772
"""
774-
return self.get_value(key, user_sync.port.integer_type, none_allowed)
773+
return self.get_value(key, int, none_allowed)
775774

776775
def get_bool(self, key, none_allowed=False):
777776
"""
778777
:rtype: bool
779778
"""
780-
return self.get_value(key, user_sync.port.boolean_type, none_allowed)
779+
return self.get_value(key, bool, none_allowed)
781780

782781
def get_list(self, key, none_allowed=False):
783782
"""
@@ -881,11 +880,18 @@ def get_value_from_keyring(secure_value_key, user_name):
881880
keyrings.cryptfile.cryptfile.CryptFileKeyring.keyring_key = "none"
882881

883882
import keyring
884-
if (isinstance(keyring.get_keyring(), keyring.backends.fail.Keyring) or
885-
isinstance(keyring.get_keyring(), keyring.backends.chainer.ChainerBackend)):
883+
k = keyring.get_keyring()
884+
885+
# If the keyring cannot connect to a backend, replace it with cryptfile
886+
if isinstance(k, keyring.backends.fail.Keyring):
886887
keyring.set_keyring(keyrings.cryptfile.cryptfile.CryptFileKeyring())
887888

888-
logging.getLogger("keyring").info("Using keyring '" + keyring.get_keyring().name + "' to retrieve: " + secure_value_key)
889+
try:
890+
name = k.backends[0].name
891+
except:
892+
name = k.name
893+
894+
logging.getLogger("keyring").info("Using keyring '{}' to retrieve: {}".format(name, secure_value_key))
889895
return keyring.get_password(service_name=secure_value_key, username=user_name)
890896

891897

@@ -1060,7 +1066,7 @@ def process_path_value(cls, val, must_exist, can_have_subdict):
10601066
:param must_exist: whether there must be a value
10611067
:param can_have_subdict: whether the value can be a tagged string
10621068
"""
1063-
if isinstance(val, six.string_types):
1069+
if isinstance(val, str):
10641070
return cls.relative_path(val, must_exist)
10651071
elif isinstance(val, list):
10661072
vals = []
@@ -1077,7 +1083,7 @@ def relative_path(cls, val, must_exist):
10771083
"""
10781084
returns an absolute path that is resolved relative to the file being loaded
10791085
"""
1080-
if not isinstance(val, six.string_types):
1086+
if not isinstance(val, str):
10811087
raise AssertionException("Expected pathname for setting %s in config file %s" %
10821088
(cls.key_path, cls.filename))
10831089
if val.startswith('$(') and val.endswith(')'):
@@ -1107,21 +1113,21 @@ def set_bool_value(self, key, default_value):
11071113
:type key: str
11081114
:type default_value: bool
11091115
"""
1110-
self.set_value(key, user_sync.port.boolean_type, default_value)
1116+
self.set_value(key, bool, default_value)
11111117

11121118
def set_int_value(self, key, default_value):
11131119
"""
11141120
:type key: str
11151121
:type default_value: int
11161122
"""
1117-
self.set_value(key, user_sync.port.integer_type, default_value)
1123+
self.set_value(key, int, default_value)
11181124

11191125
def set_string_value(self, key, default_value):
11201126
"""
11211127
:type key: str
11221128
:type default_value: Optional(str)
11231129
"""
1124-
self.set_value(key, six.string_types, default_value)
1130+
self.set_value(key, str, default_value)
11251131

11261132
def set_dict_value(self, key, default_value):
11271133
"""
@@ -1138,7 +1144,7 @@ def set_value(self, key, allowed_types, default_value):
11381144
self.options[key] = value
11391145

11401146
def require_string_value(self, key):
1141-
return self.require_value(key, six.string_types)
1147+
return self.require_value(key, str)
11421148

11431149
def require_value(self, key, allowed_types):
11441150
config = self.default_config

user_sync/connector/directory_ldap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def get_attribute_value(cls, attributes, attribute_name, first_only=False):
599599
attribute_values = attributes.get(attribute_name)
600600
if attribute_values:
601601
try:
602-
if isinstance(attribute_values, six.string_types):
602+
if isinstance(attribute_values, str):
603603
return attribute_values
604604
else:
605605
if first_only:

user_sync/port.py

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

0 commit comments

Comments
 (0)