tessl install tessl/pypi-ldap3@1.4.0A strictly RFC 4510 conforming LDAP V3 pure Python client library
Agent Success
Agent success rate when using this tile
81%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.08x
Baseline
Agent success rate without this tile
75%
A helper around an LDAP directory that binds with provided credentials, then performs basic CRUD, search, and compare operations for person entries beneath a base DN. Relative DNs such as uid=jdoe are resolved under the provided base DN.
uid=jdoe under the base DN with attributes cn=John Doe, sn=Doe, and mail=jdoe@example.com returns True and stores all supplied attribute values. @testmail changed to john.doe@example.com replaces the stored mail value and still returns True. @test(uid=jdoe) and requesting attributes cn and mail returns one result containing the DN plus exactly those attributes and lists of string values. @test(uid=missing-user) under the base DN returns an empty list. @testmail attribute for uid=jdoe against john.doe@example.com returns True; comparing it against nope@example.com returns False. @testuid=jdoe returns True when the entry exists; deleting the same DN again returns False without raising an exception. @test@generates
from typing import Any, Dict, List, Optional
class DirectoryHelper:
def __init__(self, uri: str, bind_dn: str, password: str, base_dn: str, use_ssl: bool = False) -> None: ...
def ensure_entry(self, relative_dn: str, attributes: Dict[str, List[str]]) -> bool: ...
def search(self, filter_str: str, attributes: Optional[List[str]] = None) -> List[Dict[str, Any]]: ...
def compare(self, dn: str, attribute: str, expected_value: str) -> bool: ...
def delete(self, dn: str) -> bool: ...Provides LDAP client connections plus CRUD, search, and compare operations.