Skip to content

Commit

Permalink
fix sorrt by name when list users, groups, roles
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Feb 15, 2024
1 parent c323114 commit c241703
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions keystone_scim/contrib/scim/scim.py
Expand Up @@ -135,6 +135,7 @@ def _list_users(self):
domain = self._get_domain_id_for_list_request()
refs = PROVIDERS.identity_api.list_users(
domain_scope=domain, hints=hints)
refs.sort(key=lambda d: d['name'])
scim_page_info = get_scim_page_info(hints)
# Fix bug retrieving from LDAP which not uses decorete_core_limit and then no scim info in in hints
if "totalResults" in scim_page_info and scim_page_info['totalResults'] == 0 and len(refs) > 0:
Expand Down Expand Up @@ -233,6 +234,7 @@ def _list_roles(self):
ENFORCER.enforce_call(action='identity:list_roles',
filters=filters)
refs = PROVIDERS.role_api.list_roles(hints=pagination(hints))
refs.sort(key=lambda d: d['name'])
scim_page_info = get_scim_page_info(hints)
# Fix bug retrieving from LDAP which not uses decorete_core_limit and then no scim info in in hints
if "totalResults" in scim_page_info and scim_page_info['totalResults'] == 0 and len(refs) > 0:
Expand Down Expand Up @@ -398,6 +400,7 @@ def _list_groups(self):
target_attr=target)
refs = PROVIDERS.identity_api.list_groups(
domain_scope=domain, hints=hints)
refs.sort(key=lambda d: d['name'])
scim_page_info = get_scim_page_info(hints)
# Fix bug retrieving from LDAP which not uses decorete_core_limit and then no scim info in in hints
if "totalResults" in scim_page_info and scim_page_info['totalResults'] == 0 and len(refs) > 0:
Expand Down

0 comments on commit c241703

Please sign in to comment.