CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-ldap3

A strictly RFC 4510 conforming LDAP V3 pure Python client library

81

1.08x
Overview
Eval results
Files

task.mdevals/scenario-3/

LDAP Server Profile Loader

Builds an offline-friendly profile of an LDAP server by configuring a server descriptor, preloading schema and directory info, and returning a normalized summary. Metadata can come from a dependency-provided offline directory profile or from a local JSON definition file.

Capabilities

Builds server descriptor

  • Host, port, and security mode are preserved in the returned profile header. @test

Loads offline profile metadata

  • Supplying a known offline profile key (one of the dependency's bundled offline directory templates) returns vendor name, naming contexts, and at least one object class from the dependency-provided schema without performing network calls. @test

Loads definition file metadata

  • Providing a JSON server definition with schema and server info yields matching naming contexts and object class names in the profile summary. @test

Rejects missing metadata source

  • Requesting a profile without an offline profile key or a definition file path raises a descriptive error. @test

Implementation

@generates

API

from typing import TypedDict, List, Optional, Union
from pathlib import Path

class ServerProfile(TypedDict):
    host: str
    port: int
    secure: bool
    vendor: str
    naming_contexts: List[str]
    object_classes: List[str]


def load_server_profile(
    host: str,
    port: int,
    secure: bool = False,
    offline_profile: Optional[str] = None,
    definition_path: Optional[Union[str, Path]] = None,
) -> ServerProfile:
    ...

Dependencies { .dependencies }

ldap3 { .dependency }

Lightweight LDAP client used to configure server descriptors and preload schema/DSA information.

Install with Tessl CLI

npx tessl i tessl/pypi-ldap3

tile.json