feat(ldap): implement function to check user existence

This commit is contained in:
Julian Lobbes 2022-11-15 15:09:08 +01:00
parent 5145f3a4e8
commit 65de54cfad

View File

@ -575,8 +575,8 @@ def user_exists(connection: Connection, user_dn: str) -> bool:
_assert_is_valid_connection(connection)
_assert_is_valid_user_dn(user_dn)
# TODO implement
return False
connection.search(user_dn, '(objectclass=inetOrgPerson)')
return len(connection.entries) > 0
def get_user(connection: Connection, uid: str) -> User: