Skip to content

Commit 094c737

Browse files
committed
🔊 Add additional debug messages for user and group membership
1 parent 86ab169 commit 094c737

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apricot/oauth/oauth_data_adaptor.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ def _retrieve_entries(
128128
for parent_dict in oauth_groups + user_primary_groups + groups_of_groups
129129
if child_dn in parent_dict["member"]
130130
]
131+
if self.debug:
132+
for group_name in child_dict["memberOf"]:
133+
log.msg(
134+
f"... user '{child_dict['cn']}' is a member of '{group_name}'"
135+
)
131136

132137
# Ensure memberOf is set correctly for groups
133138
for child_dict in oauth_groups + user_primary_groups + groups_of_groups:
@@ -137,6 +142,11 @@ def _retrieve_entries(
137142
for parent_dict in oauth_groups + user_primary_groups + groups_of_groups
138143
if child_dn in parent_dict["member"]
139144
]
145+
if self.debug:
146+
for group_name in child_dict["memberOf"]:
147+
log.msg(
148+
f"... group '{child_dict['cn']}' is a member of '{group_name}'"
149+
)
140150

141151
# Annotate group and user dicts with the appropriate LDAP classes
142152
annotated_groups = [

0 commit comments

Comments
 (0)