Skip to content

Commit

Permalink
Merge branch 'adobe-apiplatform:v2' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Luci2015 authored Jun 4, 2024
2 parents b8d5e58 + b1dfbe7 commit b093020
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .changelog/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
| tag | date | title |
|------------|------------|---------------------------|
| v2.10.0rc2 | 2023-10-19 | User Sync Tool v2.10.0rc2 |

# Fixes

* e61ec81 Fix issue with all users setting

# New Features

* d761c5e Introduce option to limit scope of Adobe-only users to just those that
have groups to remove in the current sync. See [the
manual](https://github.com/adobe-apiplatform/user-sync.py/blob/8082c987c79eddcc3fc06f31a1c32de300a30cd7/en/user-manual/configuring_user_sync_tool.md#limits-config)
for more information

---

| tag | date | title |
|------------|------------|---------------------------|
| v2.10.0rc1 | 2023-09-27 | User Sync Tool v2.10.0rc1 |
Expand Down
7 changes: 7 additions & 0 deletions .changelog/latest.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Fixes

* e61ec81 Fix issue with all users setting

# New Features

* d761c5e Introduce option to limit scope of Adobe-only users to just those that
have groups to remove in the current sync. See [the
manual](https://github.com/adobe-apiplatform/user-sync.py/blob/8082c987c79eddcc3fc06f31a1c32de300a30cd7/en/user-manual/configuring_user_sync_tool.md#limits-config)
for more information
1 change: 1 addition & 0 deletions examples/config files - basic/user-sync-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ directory_users:
# See https://adobe-apiplatform.github.io/user-sync.py/en/user-manual/configuring_user_sync_tool.html#limits-config
limits:
max_adobe_only_users: 200
# group_removals_only: True

# --- Logging Options ---
# Options that govern logging to the terminal (console) and/or log file(s)
Expand Down
3 changes: 3 additions & 0 deletions user_sync/config/user_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ def get_engine_options(self):
limits_config = self.main_config.get_dict_config('limits')
max_missing = limits_config.get_value('max_adobe_only_users', (int, str), False)
options['max_adobe_only_users'] = validate_max_limit_config(max_missing)
group_removals_only = limits_config.get_value('group_removals_only', bool, True)
if group_removals_only is not None:
options['group_removals_only'] = group_removals_only

# now get the directory extension, if any
extension_config = self.get_directory_extension_options()
Expand Down
2 changes: 1 addition & 1 deletion user_sync/engine/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def update_sign_users(self, directory_users, sign_connector: SignConnector, org_
if is_admin:
self.logger.info(f"Assigning account admin status to {sign_user.email}")
else:
self.logger.info(f"Removing account admin status from f{sign_user.email}")
self.logger.info(f"Removing account admin status from {sign_user.email}")
user_data = DetailedUserInfo(**sign_user.__dict__)
user_data.isAccountAdmin = is_admin
self.sign_users_role_updates.add(sign_user.email)
Expand Down
8 changes: 6 additions & 2 deletions user_sync/engine/umapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class RuleProcessor(object):
'exclude_users': [],
'extended_attributes': set(),
'extension_enabled': False,
'group_removals_only': False,
'process_groups': False,
'max_adobe_only_users': 200,
'new_account_type': user_sync.identity_type.ENTERPRISE_IDENTITY_TYPE,
Expand Down Expand Up @@ -489,7 +490,7 @@ def sync_umapi_users(self, umapi_connectors):
self.logger.debug('%sing users to umapi...', verb)
umapi_info, umapi_connector = self.get_umapi_info(PRIMARY_TARGET_NAME), umapi_connectors.get_primary_connector()
if self.push_umapi:
primary_adds = umapi_info.get_desired_groups_by_user_key().data
primary_adds = umapi_info.get_desired_groups_by_user_key()
else:
primary_adds, update_commands = self.update_umapi_users_for_connector(umapi_info, umapi_connector)
primary_commands.extend(update_commands)
Expand Down Expand Up @@ -611,7 +612,10 @@ def is_selected_user_key(self, user_key):
return True

def get_stray_keys(self, umapi_name=PRIMARY_TARGET_NAME):
return self.stray_key_map.get(umapi_name, {})
key_map = self.stray_key_map.get(umapi_name, {})
if self.options['group_removals_only']:
return {key: groups for key, groups in key_map.items() if groups}
return key_map

def add_stray(self, umapi_name, user_key, removed_groups=None):
"""
Expand Down
2 changes: 1 addition & 1 deletion user_sync/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

__version__ = '2.10.0rc1'
__version__ = '2.10.0rc2'

0 comments on commit b093020

Please sign in to comment.