CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-ldap3

tessl install tessl/pypi-ldap3@1.4.0

A 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%

task.mdevals/scenario-9/

LDAP Entry Provisioning Helper

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.

Capabilities

Maintains entries

  • Creating an entry for 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. @test
  • Calling the same entry creation again with mail changed to john.doe@example.com replaces the stored mail value and still returns True. @test

Searches entries

  • Searching with filter (uid=jdoe) and requesting attributes cn and mail returns one result containing the DN plus exactly those attributes and lists of string values. @test
  • Searching with filter (uid=missing-user) under the base DN returns an empty list. @test

Compares attributes

  • Comparing the mail attribute for uid=jdoe against john.doe@example.com returns True; comparing it against nope@example.com returns False. @test

Removes entries

  • Deleting uid=jdoe returns True when the entry exists; deleting the same DN again returns False without raising an exception. @test

Implementation

@generates

API

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: ...

Dependencies { .dependencies }

ldap3 { .dependency }

Provides LDAP client connections plus CRUD, search, and compare operations.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/ldap3@1.4.x
tile.json