Skip to content

Commit b093020

Browse files
authored
Merge branch 'adobe-apiplatform:v2' into patch-1
2 parents b8d5e58 + b1dfbe7 commit b093020

File tree

7 files changed

+36
-4
lines changed

7 files changed

+36
-4
lines changed

.changelog/changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
| tag | date | title |
2+
|------------|------------|---------------------------|
3+
| v2.10.0rc2 | 2023-10-19 | User Sync Tool v2.10.0rc2 |
4+
5+
# Fixes
6+
7+
* e61ec81 Fix issue with all users setting
8+
9+
# New Features
10+
11+
* d761c5e Introduce option to limit scope of Adobe-only users to just those that
12+
have groups to remove in the current sync. See [the
13+
manual](https://github.com/adobe-apiplatform/user-sync.py/blob/8082c987c79eddcc3fc06f31a1c32de300a30cd7/en/user-manual/configuring_user_sync_tool.md#limits-config)
14+
for more information
15+
16+
---
17+
118
| tag | date | title |
219
|------------|------------|---------------------------|
320
| v2.10.0rc1 | 2023-09-27 | User Sync Tool v2.10.0rc1 |

.changelog/latest.md

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

33
* e61ec81 Fix issue with all users setting
4+
5+
# New Features
6+
7+
* d761c5e Introduce option to limit scope of Adobe-only users to just those that
8+
have groups to remove in the current sync. See [the
9+
manual](https://github.com/adobe-apiplatform/user-sync.py/blob/8082c987c79eddcc3fc06f31a1c32de300a30cd7/en/user-manual/configuring_user_sync_tool.md#limits-config)
10+
for more information

examples/config files - basic/user-sync-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ directory_users:
7979
# See https://adobe-apiplatform.github.io/user-sync.py/en/user-manual/configuring_user_sync_tool.html#limits-config
8080
limits:
8181
max_adobe_only_users: 200
82+
# group_removals_only: True
8283

8384
# --- Logging Options ---
8485
# Options that govern logging to the terminal (console) and/or log file(s)

user_sync/config/user_sync.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ def get_engine_options(self):
531531
limits_config = self.main_config.get_dict_config('limits')
532532
max_missing = limits_config.get_value('max_adobe_only_users', (int, str), False)
533533
options['max_adobe_only_users'] = validate_max_limit_config(max_missing)
534+
group_removals_only = limits_config.get_value('group_removals_only', bool, True)
535+
if group_removals_only is not None:
536+
options['group_removals_only'] = group_removals_only
534537

535538
# now get the directory extension, if any
536539
extension_config = self.get_directory_extension_options()

user_sync/engine/sign.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def update_sign_users(self, directory_users, sign_connector: SignConnector, org_
191191
if is_admin:
192192
self.logger.info(f"Assigning account admin status to {sign_user.email}")
193193
else:
194-
self.logger.info(f"Removing account admin status from f{sign_user.email}")
194+
self.logger.info(f"Removing account admin status from {sign_user.email}")
195195
user_data = DetailedUserInfo(**sign_user.__dict__)
196196
user_data.isAccountAdmin = is_admin
197197
self.sign_users_role_updates.add(sign_user.email)

user_sync/engine/umapi.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class RuleProcessor(object):
4949
'exclude_users': [],
5050
'extended_attributes': set(),
5151
'extension_enabled': False,
52+
'group_removals_only': False,
5253
'process_groups': False,
5354
'max_adobe_only_users': 200,
5455
'new_account_type': user_sync.identity_type.ENTERPRISE_IDENTITY_TYPE,
@@ -489,7 +490,7 @@ def sync_umapi_users(self, umapi_connectors):
489490
self.logger.debug('%sing users to umapi...', verb)
490491
umapi_info, umapi_connector = self.get_umapi_info(PRIMARY_TARGET_NAME), umapi_connectors.get_primary_connector()
491492
if self.push_umapi:
492-
primary_adds = umapi_info.get_desired_groups_by_user_key().data
493+
primary_adds = umapi_info.get_desired_groups_by_user_key()
493494
else:
494495
primary_adds, update_commands = self.update_umapi_users_for_connector(umapi_info, umapi_connector)
495496
primary_commands.extend(update_commands)
@@ -611,7 +612,10 @@ def is_selected_user_key(self, user_key):
611612
return True
612613

613614
def get_stray_keys(self, umapi_name=PRIMARY_TARGET_NAME):
614-
return self.stray_key_map.get(umapi_name, {})
615+
key_map = self.stray_key_map.get(umapi_name, {})
616+
if self.options['group_removals_only']:
617+
return {key: groups for key, groups in key_map.items() if groups}
618+
return key_map
615619

616620
def add_stray(self, umapi_name, user_key, removed_groups=None):
617621
"""

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.10.0rc1'
21+
__version__ = '2.10.0rc2'

0 commit comments

Comments
 (0)