• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 10 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LDAP server, client and utilities, using Twisted Python

Ldaptor

Codecov Read the Docs GitHub Actions PyPI Black

Ldaptor is a pure-Python library that implements:

  • LDAP client logic
  • separately-accessible LDAP and BER protocol message generation/parsing
  • ASCII-format LDAP filter generation and parsing
  • LDIF format data generation
  • Samba password changing logic

Also included is a set of LDAP utilities for use from the command line.

Verbose documentation can be found on ReadTheDocs.

Quick Usage Example

from twisted.internet import reactor, defer
from ldaptor.protocols.ldap import ldapclient, ldapsyntax, ldapconnector

@defer.inlineCallbacks
def example():
    # The following arguments may be also specified as unicode strings
    # but it is recommended to use byte strings for ldaptor objects
    serverip = b'192.168.128.21'
    basedn = b'dc=example,dc=com'
    binddn = b'[email protected]'
    bindpw = b'secret'
    query = b'(cn=Babs*)'
    c = ldapconnector.LDAPClientCreator(reactor, ldapclient.LDAPClient)
    overrides = {basedn: (serverip, 389)}
    client = yield c.connect(basedn, overrides=overrides)
    yield client.bind(binddn, bindpw)
    o = ldapsyntax.LDAPEntry(client, basedn)
    results = yield o.search(filterText=query)
    for entry in results:
        print(entry.getLDIF())

if __name__ == '__main__':
    df = example()
    df.addErrback(lambda err: err.printTraceback())
    df.addCallback(lambda _: reactor.stop())
    reactor.run()

Installation

Ldaptor can be installed using the standard command line method:

python setup.py install

or using pip from PyPI:

pip install ldaptor

Linux distributions may also have ready packaged versions of Ldaptor and Twisted. Debian and Ubuntu have quality Ldaptor packages that can be installed e.g., by:

apt-get install python-ldaptor

To run the LDAP server (bind port 38942) from a repo checkout with the project installed:

twistd -n --pidfile=ldapserver.pid --logfile=ldapserver.log \
    -y test-ldapserver.tac

Dependencies:

More Repositories

1

twisted

Event-driven networking engine written in Python.
Python
5,498
star
2

klein

werkzeug + twisted.web
Python
834
star
3

towncrier

Manage the release notes for your project.
Python
760
star
4

treq

Python requests like API built on top of Twisted's HTTP client.
Python
585
star
5

txmongo

asynchronous python driver for mongo
Python
337
star
6

pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
Python
180
star
7

incremental

A library for versioning your Python projects.
Python
133
star
8

vertex

Vertex is a generalized, secure, peer-to-peer communications platform; formerly of the divmod.org project (https://code.launchpad.net/divmod.org/)
Python
74
star
9

nevow

Web Application Construction Kit
Python
62
star
10

tubes

A series of tubes.
Python
55
star
11

qt5reactor

Twisted and PyQt5 eventloop integration. Borrowed from https://github.com/nehbit/aether-public/blob/master/qt5reactor.py
Python
47
star
12

txacme

Twisted client for the ACME (Automatic Certificate Management Environment) protocol
Python
45
star
13

imaginary

Imaginary is a system for building fictional, interactive worlds via parallel, intersecting simulations.
Python
34
star
14

txaws

Twisted-based Asynchronous Libraries for Amazon Web Services and clouds that support the AWS APIs
Python
32
star
15

axiom

Divmod Axiom is an object database, or alternatively, an object-relational mapper, implemented on top of Python.
Python
22
star
16

constantly

Symbolic Constants in Python
Python
22
star
17

ampoule

Process pool for Twisted, using AMP
Python
12
star
18

twistedchecker

twistedchecker is a tool to automatically verify code against the Twisted coding standard.
Python
9
star
19

filepath

An object-oriented API for manipulating filesystem paths on POSIX and Windows.
Python
8
star
20

twisted-dev-tools

Tools for twisted development.
Python
7
star
21

mantissa

Divmod Mantissa is an application server with a web interface built using Axiom and Nevow.
Python
6
star
22

quotient

Divmod Quotient is a messaging platform developed as an Offering for Divmod Mantissa.
Python
6
star
23

newsbuilder

Automatically generate and manage a NEWS file from snippets stored in per-ticket text files.
Python
5
star
24

epsilon

Library of utility modules, used by ex-Divmod projects
Python
4
star
25

trac-wiki-archive

Archive for the content of previous Trac Wiki
4
star
26

twisted.github.io

This is the repo for the Twisted Matrix presentation site
JavaScript
3
star
27

sine

Divmod Sine is a standards-based voice-over-IP application server, built as an offering for the Mantissa application server platform.
Python
3
star
28

hyperbola

Hyperbola is a blogging and forums system, for having discussions about things.
Python
3
star
29

parsley-protocols

Python
2
star
30

twisted-iocpsupport

`twisted-iocpsupport` is an extension module for the Twisted `iocp` reactor to use the Windows I/O Completion Ports (IOCP) networking API. You should not need to install it directly or interact with its API; it is a dependency of Twisted on Windows platforms.
Cython
2
star
31

documents

Hosting via GitHub Pages for legacy documentation files
1
star
32

python-info-action

A GitHub Actions action for printing Python environment information
Python
1
star
33

cython-test-exception-raiser

Testing only. A cython simple extension which is used as helper for twisted/twisted Failure tests.
Cython
1
star