File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -83,3 +83,6 @@ def _bind(password: bytes) -> "OAuthLDAPEntry":
83
83
raise LDAPInvalidCredentials (msg )
84
84
85
85
return defer .maybeDeferred (_bind , password )
86
+
87
+ def list_children (self ) -> "list[OAuthLDAPEntry]" :
88
+ return [cast (OAuthLDAPEntry , entry ) for entry in self ._children .values ()]
Original file line number Diff line number Diff line change @@ -67,15 +67,29 @@ def root(self) -> OAuthLDAPEntry:
67
67
68
68
# Add groups to the groups OU
69
69
if self .debug :
70
- log .msg (f"Adding { len (oauth_adaptor .groups )} groups to the LDAP tree." )
70
+ log .msg (
71
+ f"Attempting to add { len (oauth_adaptor .groups )} groups to the LDAP tree."
72
+ )
71
73
for group_attrs in oauth_adaptor .groups :
72
74
groups_ou .add_child (f"CN={ group_attrs .cn } " , group_attrs .to_dict ())
75
+ if self .debug :
76
+ children = groups_ou .list_children ()
77
+ for child in children :
78
+ log .msg (f"... { child .dn .getText ()} " )
79
+ log .msg (f"There are { len (children )} groups in the LDAP tree." )
73
80
74
81
# Add users to the users OU
75
82
if self .debug :
76
- log .msg (f"Adding { len (oauth_adaptor .users )} users to the LDAP tree." )
83
+ log .msg (
84
+ f"Attempting to add { len (oauth_adaptor .users )} users to the LDAP tree."
85
+ )
77
86
for user_attrs in oauth_adaptor .users :
78
87
users_ou .add_child (f"CN={ user_attrs .cn } " , user_attrs .to_dict ())
88
+ if self .debug :
89
+ children = users_ou .list_children ()
90
+ for child in children :
91
+ log .msg (f"... { child .dn .getText ()} " )
92
+ log .msg (f"There are { len (children )} users in the LDAP tree." )
79
93
80
94
# Set last updated time
81
95
log .msg ("Finished building LDAP tree." )
You can’t perform that action at this time.
0 commit comments