Registry / auth-security / ldappool

ldappool

JSON →
library3.0.0pypypiunverified

A simple connector pool for python-ldap. Current version 3.0.0 (released 2021). Provides a pool of LDAP connections to reuse, reducing overhead of creating new connections. Stable release cadence, maintenance mode.

pip install ldappool
INSTALL
IMPORT
SIG · LDAPPOOL
L
ldappool
auth-securitypythonv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ConnectionManager
from ldappool import ConnectionManager
from ldappool import ConnectionManager

Create a pool and get a connection. Connection object is a python-ldap connection with reset() method to return to pool.

from ldappool import ConnectionManager manager = ConnectionManager( uri='ldap://ldap.example.com', binddn='cn=admin,dc=example,dc=com', password='secret', size=10 ) conn = manager.get_connection() # use conn (python-ldap connection) print(conn.search_s('dc=example,dc=com', 2, '(objectClass=*)', ['dn'])) conn.reset() # return to pool
Debug
Known issues
gotchaConnections obtained from pool MUST be returned via .reset() or they will be leaked and eventually exhausted.
fix
Always call conn.reset() or use context manager (with manager.connection() as conn:).
affects: all
breakingIn version 3.0.0, the 'pool' module was removed; imports from ldappool.pool will fail.
fix
Use 'from ldappool import ConnectionManager' instead.
affects: 2.x -> 3.0.0
deprecatedThe 'ldappool.ConnectionManager' constructor argument 'round_robin' is deprecated. Use 'strategy' instead.
fix
Set strategy='round_robin' instead of round_robin=True.
affects: >=3.0.0
Upgrade
Version history
3.0.0latest on PyPI · released Feb 26, 2021
Audit
Dependencies
python-ldaprequiredCore dependency for LDAP operations
Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
ldappool — pip install ldappool · libregistry