Skip to content

Commit

Permalink
🔊 Add additional debug messages for user and group membership
Browse files Browse the repository at this point in the history
  • Loading branch information
jemrobinson committed May 21, 2024
1 parent fa369ef commit 48455c6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apricot/oauth/oauth_data_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ def _retrieve_entries(
for parent_dict in oauth_groups + user_primary_groups + groups_of_groups
if child_dn in parent_dict["member"]
]
if self.debug:
for group_name in child_dict["memberOf"]:
log.msg(
f"... user '{child_dict['cn']}' is a member of '{group_name}'"
)

# Ensure memberOf is set correctly for groups
for child_dict in oauth_groups + user_primary_groups + groups_of_groups:
Expand All @@ -137,6 +142,11 @@ def _retrieve_entries(
for parent_dict in oauth_groups + user_primary_groups + groups_of_groups
if child_dn in parent_dict["member"]
]
if self.debug:
for group_name in child_dict["memberOf"]:
log.msg(
f"... group '{child_dict['cn']}' is a member of '{group_name}'"
)

# Annotate group and user dicts with the appropriate LDAP classes
annotated_groups = [
Expand Down

0 comments on commit 48455c6

Please sign in to comment.