Skip to content

Commit 0235ebc

Browse files
authored
Merge pull request #270 from adobe-apiplatform/v2
User Sync v2.2.1 - bug fix release
2 parents 51de7e2 + f891fad commit 0235ebc

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

RELEASE_NOTES.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release Notes for User Sync Tool Version 2.2.1
22

3-
These notes apply to v2.2.1rc1 of 2017-08-28.
3+
These notes apply to v2.2.1 of 2017-08-30.
44

55
## New Features
66

@@ -9,16 +9,20 @@ These notes apply to v2.2.1rc1 of 2017-08-28.
99
* a `str` (or `unicode` in py2) if the attribute has one value;
1010
* a `list` of `str` (or `unicode` in py2) if the attribute has multiple values.
1111

12+
[#268](https://github.com/adobe-apiplatform/user-sync.py/issues/268): To make sure users get all the right overlapping entitlements associated with mapped user groups, `--strategy push` now does group removals before group adds.
13+
1214
## Bug Fixes
1315

1416
[#257](https://github.com/adobe-apiplatform/user-sync.py/issues/257): Catch exceptions thrown by umapi-client when creating actions.
1517

16-
[#258](https://github.com/adobe-apiplatform/user-sync.py/issues/258): Correctly decrypte private keys in py3.
18+
[#258](https://github.com/adobe-apiplatform/user-sync.py/issues/258): Correctly decrypt private keys in py3.
1719

1820
[#260](https://github.com/adobe-apiplatform/user-sync.py/issues/260): Make sure the requests library is loaded when using pex on Windows.
1921

2022
[#265](https://github.com/adobe-apiplatform/user-sync.py/issues/265): Extended attributes in extensions couldn't be fetched unless they had non-ascii names.
2123

24+
[#269](https://github.com/adobe-apiplatform/user-sync.py/issues/269): When using `--strategy sync`, new users created in secondary organizations were not being added to any groups.
25+
2226
## Compatibility with Prior Versions
2327

2428
There are no functional changes from prior versions.

tests/rules_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,21 @@ def mock_load_users_and_groups(groups=None, extended_attributes=None, all_users=
155155
user = everybody[0]
156156
commands = tests.helper.create_umapi_commands(user)
157157
commands.add_user(self.create_user_attributes_for_commands(user, rule_options['update_user_info']))
158-
commands.add_groups(set([primary_group_11]))
159158
commands.remove_groups(set([primary_group_21]))
159+
commands.add_groups(set([primary_group_11]))
160160
expected_primary_commands_list.append(commands)
161161

162162
user = everybody[1]
163163
commands = tests.helper.create_umapi_commands(user)
164164
commands.add_user(self.create_user_attributes_for_commands(user, rule_options['update_user_info']))
165-
commands.add_groups(set([primary_group_21]))
166165
commands.remove_groups(set([primary_group_11]))
166+
commands.add_groups(set([primary_group_21]))
167167
expected_primary_commands_list.append(commands)
168168

169169
user = everybody[2]
170170
commands = tests.helper.create_umapi_commands(user)
171-
commands.add_user(self.create_user_attributes_for_commands(user, rule_options['update_user_info']))
172171
commands.remove_groups(set([primary_group_11, primary_group_21]))
172+
commands.add_user(self.create_user_attributes_for_commands(user, rule_options['update_user_info']))
173173
expected_primary_commands_list.append(commands)
174174

175175
expected_secondary_commands_list = []

user_sync/rules.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,10 @@ def add_umapi_user(self, user_key, groups_to_add, umapi_connectors):
647647
self.action_summary['adobe_users_created'] += 1
648648
primary_commands.add_user(attributes)
649649
if manage_groups:
650-
primary_commands.add_groups(groups_to_add)
651650
if doing_push:
652651
groups_to_remove = self.get_umapi_info(PRIMARY_UMAPI_NAME).get_mapped_groups() - groups_to_add
653652
primary_commands.remove_groups(groups_to_remove)
653+
primary_commands.add_groups(groups_to_add)
654654
umapi_connectors.get_primary_connector().send_commands(primary_commands)
655655
# add the user to secondaries, maybe with groups
656656
attributes['option'] = 'ignoreIfAlreadyExists' # can only update in the owning org
@@ -662,10 +662,11 @@ def add_umapi_user(self, user_key, groups_to_add, umapi_connectors):
662662
self.logger.info('Adding directory user to %s with user key: %s', umapi_name, user_key)
663663
secondary_commands = self.create_commands_from_directory_user(directory_user, identity_type)
664664
secondary_commands.add_user(attributes)
665-
if manage_groups and doing_push:
665+
if manage_groups:
666+
if doing_push:
667+
groups_to_remove = secondary_umapi_info.get_mapped_groups() - groups_to_add
668+
secondary_commands.remove_groups(groups_to_remove)
666669
secondary_commands.add_groups(groups_to_add)
667-
groups_to_remove = secondary_umapi_info.get_mapped_groups() - groups_to_add
668-
secondary_commands.remove_groups(groups_to_remove)
669670
umapi_connector.send_commands(secondary_commands)
670671

671672
def update_umapi_user(self, umapi_info, user_key, umapi_connector,

user_sync/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
__version__ = '2.2.1rc1'
21+
__version__ = '2.2.1'

0 commit comments

Comments
 (0)