Skip to content

Commit

Permalink
WIP: Add some helpful comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmaw committed Nov 7, 2022
1 parent 18da399 commit b150b0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lifecycle/source_ldap3.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def fetch_groups(self):
else:
description = ""
group = Group(name, description, ldap_group["mail"])

# member is of the format uid=admin,cn=users,cn=accounts,...
for member in ldap_group["member"]:
components = member.split(",")
uid = components[0].split("=")[1]
Expand Down
5 changes: 5 additions & 0 deletions lifecycle/target_ldap3.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def _user_to_ldap_changes(user: User) -> dict:
# 'uid' is also a field that could go into ldap changes, but we don't expect that to ever change

# XXX: HOW DO I SET WHICH USERS ARE MEMBERS OF GROUPS?
# Get the Groups that the User is a part of,
# Search for them in LDAP
# And update every Group entry to add/remove/update the list of "member"
# to include the User's dn.
# XXX: Hang on, do users' DN start with "uid=" or "cn="?
lock_status = "TRUE" if user.locked else "FALSE"
return {
"givenName": [(ldap3.MODIFY_REPLACE, [user.forename])],
Expand Down

0 comments on commit b150b0b

Please sign in to comment.