ldap: Work-arround with AD invalid return on searching objects
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Benjamin Renard 2022-12-02 12:09:40 +01:00
parent 85d34b7b9a
commit 651e1a1a6c

View file

@ -581,6 +581,9 @@ class LdapClient:
objects = {} objects = {}
for obj_dn, obj_attrs in ldap_data.items(): for obj_dn, obj_attrs in ldap_data.items():
# Ignore invalid result (view with an AD)
if not obj_dn or not isinstance(obj_attrs, dict):
continue
objects[obj_dn] = self._get_obj(obj_dn, obj_attrs) objects[obj_dn] = self._get_obj(obj_dn, obj_attrs)
self._cached_objects[name] = objects self._cached_objects[name] = objects
if not key_attr or key_attr == 'dn': if not key_attr or key_attr == 'dn':