{"id":13725389,"url":"https://github.com/openstack/ldappool","last_synced_at":"2025-05-06T10:33:20.360Z","repository":{"id":66174751,"uuid":"58666441","full_name":"openstack/ldappool","owner":"openstack","description":"A simple connector pool for python-ldap and related LDAP libraries. Mirror of code maintained at opendev.org.","archived":false,"fork":false,"pushed_at":"2024-09-06T14:35:58.000Z","size":118,"stargazers_count":15,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-13T18:15:51.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://opendev.org/openstack/ldappool","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openstack.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-12T18:27:09.000Z","updated_at":"2024-09-06T14:36:02.000Z","dependencies_parsed_at":"2024-09-06T16:47:38.172Z","dependency_job_id":"d1e44fab-fd35-4a24-8c90-85e015d5238d","html_url":"https://github.com/openstack/ldappool","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fldappool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fldappool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fldappool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fldappool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openstack","download_url":"https://codeload.github.com/openstack/ldappool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224499851,"owners_count":17321605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:21.530Z","updated_at":"2024-11-13T18:15:54.862Z","avatar_url":"https://github.com/openstack.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"ldappool\n========\n\nA simple connector pool for python-ldap.\n\nThe pool keeps LDAP connectors alive and let you reuse them,\ndrastically reducing the time spent to initiate a ldap connection.\n\nThe pool has useful features like:\n\n- transparent reconnection on failures or server restarts\n- configurable pool size and connectors timeouts\n- configurable max lifetime for connectors\n- a context manager to simplify acquiring and releasing a connector\n\n**You need python-ldap in order to use this library**\n\nQuickstart\n::::::::::\n\nTo work with the pool, you just need to create it, then use it as a\ncontext manager with the *connection* method::\n\n    from ldappool import ConnectionManager\n\n    cm = ConnectionManager('ldap://localhost')\n\n    with cm.connection('uid=adminuser,ou=logins,dc=mozilla', 'password') as conn:\n        .. do something with conn ..\n\n\nThe connector returned by *connection* is a LDAPObject, that's binded to the\nserver. See https://pypi.org/project/python-ldap/ for details on how to use a connector.\n\nIt is possible to check the state of the pool by representing the pool as a string::\n\n    from ldappool import ConnectionManager\n\n    cm = ConnectionManager('ldap://localhost', size=2)\n\n    .. do something with cm ..\n\n    print(cm)\n\nThis will result in output similar to this table::\n\n    +--------------+-----------+----------+------------------+--------------------+------------------------------+\n    | Slot (2 max) | Connected |  Active  |       URI        | Lifetime (600 max) |           Bind DN            |\n    +--------------+-----------+----------+------------------+--------------------+------------------------------+\n    |      1       | connected | inactive | ldap://localhost |  0.00496101379395  | uid=tuser,dc=example,dc=test |\n    |      2       | connected | inactive | ldap://localhost |  0.00532603263855  | uid=tuser,dc=example,dc=test |\n    +--------------+-----------+----------+------------------+--------------------+------------------------------+\n\n\nConnectionManager options\n:::::::::::::::::::::::::\n\nHere are the options you can use when instanciating the pool:\n\n- **uri**: ldap server uri **[mandatory]**\n- **bind**: default bind that will be used to bind a connector.\n  **default: None**\n- **passwd**: default password that will be used to bind a connector.\n  **default: None**\n- **size**: pool size. **default: 10**\n- **retry_max**: number of attempts when a server is down. **default: 3**\n- **retry_delay**: delay in seconds before a retry. **default: .1**\n- **use_tls**: activate TLS when connecting. **default: False**\n- **timeout**: connector timeout. **default: -1**\n- **use_pool**: activates the pool. If False, will recreate a connector\n  each time. **default: True**\n\nThe **uri** option will accept a comma or whitespace separated list of LDAP\nserver URIs to allow for failover behavior when connection errors are\nencountered.  Connections will be attempted against the servers in order,\nwith **retry_max** attempts per URI before failing over to the next server.\n\nThe **connection** method takes two options:\n\n- **bind**: bind used to connect. If None, uses the pool default's.\n  **default: None**\n- **passwd**: password used to connect. If None, uses the pool default's.\n  **default: None**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fldappool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenstack%2Fldappool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fldappool/lists"}