Project Overview
Relevant source files
The following files were used as context for generating this wiki page:
flext-tap-ldap is a specialized Singer Tap designed for extracting data from LDAP (Lightweight Directory Access Protocol) directory services. It is built using the FLEXT framework, utilizing flext-core, flext-ldap, and flext-meltano to provide a typed, enterprise-grade ETL (Extract, Transform, Load) solution. The tap supports standard LDAP directory queries, LDIF (LDAP Data Interchange Format) file processing, and specific enrichments for Oracle Unified Directory (OID) environments.
Sources: README.md:9-11, pyproject.toml:26-31, src/flext_tap_ldap/tap.py:16-25
Core Architecture
The tap is built on the FlextMeltanoAbstractions base class, which provides the standard Singer protocol implementation. It leverages a modular utility system for LDIF processing and client support, delegating complex LDAP operations to the flext-ldif and flext-ldap libraries.
System Components
The following diagram illustrates the relationship between the Tap, its internal utility mixins, and external library dependencies.
Configuration and Discovery
The tap utilizes a centralized configuration schema defined via Pydantic and JSON Schema. It supports various connection parameters and operational flags, such as enabling specific LDIF processing streams.
Settings and Options
| Parameter | Type | Default | Description |
|---|---|---|---|
host | string | - | LDAP server host address. |
port | integer | 389 | LDAP server port. |
use_ssl | boolean | False | Whether to use LDAPS (SSL/TLS). |
bind_dn | string | - | Distinguished Name for authentication. |
base_dn | string | - | The starting point for directory searches. |
enable_ldif_streams | boolean | False | Toggle for LDIF file processing streams. |
ldif_directory | string | - | Path to search for LDIF files. |
Sources: src/flext_tap_ldap/tap.py:53-110
Stream Discovery Logic
During discovery, the tap identifies standard LDAP streams and dynamically adds LDIF or custom streams based on the provided configuration.
Sources: src/flext_tap_ldap/tap.py:125-157
LDIF Processing Utilities
The FlextTapLdapUtilitiesProcessorMixin provides a sophisticated toolset for handling LDIF content. It includes three primary sub-classes for processing, validating, and transforming LDAP entries.
Processor, Validator, and Transformer
- Processor: Handles parsing LDIF files or raw strings into structured entry objects. It tracks statistics such as
processed_entries,skipped_entries, and parsingerrors. - Validator: Uses
flext-ldifcapabilities to verify entries against LDAP standards, returning detailed error and warning payloads. - Transformer: Applies transformation rules including attribute mappings, schema normalization, attribute removal/addition, and value-level mapping (e.g., mapping "IT" to "Information Technology").
Sources: src/flext_tap_ldap/_utilities/_processor.py:145-200, src/flext_tap_ldap/_utilities/_processor.py:315-345, src/flext_tap_ldap/_utilities/_processor.py:359-450
Client and Oracle Support
The tap includes specialized logic for Oracle-specific LDAP environments (Oracle Internet Directory / Unified Directory). The ClientSupport utility manages normalization of entries and URI construction.
Oracle Normalization
The normalize_oracle_entry function performs specific adjustments:
- Maps
orclPasswordtouserPassword. - Enriches
objectClassby addingorganizationalUnitiforclContaineris present butorganizationalUnitis missing. - Extends attribute requests to include OID-specific fields like
orclPasswordAttribute.
Sources: src/flext_tap_ldap/_utilities/client_support.py:73-110
Operational Flow
The execution flow of the tap follows the standard Singer CLI pattern, allowing for discovery and sync modes via command-line arguments.
Conclusion
flext-tap-ldap provides a robust, framework-aligned integration for LDAP services. By combining standard directory traversal with advanced LDIF processing and Oracle-specific support, it ensures high-fidelity data extraction for complex enterprise identity environments. The project adheres to "Zero-Tolerance" engineering laws as defined in the AGENTS.md governance pointer, ensuring root-cause fixes and strict typing.
Sources: README.md:16-20, AGENTS.md:20-35