Python tool for managing LLDAP servers
Project description
lldap-py
Python client library for managing LLDAP servers lldap/lldap
Usage
This package provides a Python interface to interact with LLDAP servers for user and group management. The idea is that it would be used in an onboarding/offboarding automation script and make similar automation tasks easier.
Quickstart
- Install the package.
- Create a
LLDAPManagerwith your server URL and credentials. - Use the user and group helpers to perform actions.
from lldap import LLDAPManager
manager = LLDAPManager(
http_url="http://localhost:17170",
username="admin",
password="your-password",
# Needed for LDAP password changes
base_dn="dc=example,dc=com",
ldap_server="ldap://localhost:3890",
)
users = manager.list_users()
groups = manager.list_groups()
user_id = "jdoe"
manager.create_user(
user_id,
"jdoe@example.com",
"Jane Doe",
"Jane",
"Doe",
)
group_id = manager.get_group_id("BasicUserGroup")
if group_id is not None:
manager.add_user_to_group(user_id, group_id)
# Requires base_dn and ldap_server
manager.set_password(user_id, "TempPassw0rd!")
manager.close()
Notes:
- You can authenticate with
tokenorrefresh_tokeninstead ofusernameandpassword. - Set
verify_ssl=Falseif you are connecting to a test server with self-signed certs.
Installation
You can install the package via pip:
pip install lldap-py
https://pypi.org/project/lldap-py
Requirements
- Python 3.8+
- requests
- ldap3
- toml
- click
TODO
- Maybe improve error handling and passing of graphql errors to the user.
- Add more examples and documentation.
- Check coverage of tests
- Add support for costum user and group attributes.
Credit
This project is heavely inspired by and uses alot of code from Zepmann/lldap-cli and JaidenW/LLDAP-Discord
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lldap_py-0.2.0.tar.gz.
File metadata
- Download URL: lldap_py-0.2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75f4e9b68d1ccf47802e01f0e33bffb898db9c71e01cee1c2383f63dddfffa6a
|
|
| MD5 |
013a6bce160d9555ca71022d8c1dfc09
|
|
| BLAKE2b-256 |
fc4d1d64056c06dd4b06ccce79b921380d002baaeb173c2adfbf202fa4514c87
|
Provenance
The following attestation bundles were made for lldap_py-0.2.0.tar.gz:
Publisher:
publish_pypi.yml on luca2618/lldap-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lldap_py-0.2.0.tar.gz -
Subject digest:
75f4e9b68d1ccf47802e01f0e33bffb898db9c71e01cee1c2383f63dddfffa6a - Sigstore transparency entry: 924292948
- Sigstore integration time:
-
Permalink:
luca2618/lldap-py@a8d33ef83a184c500a738eced52187f023a57228 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/luca2618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@a8d33ef83a184c500a738eced52187f023a57228 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file lldap_py-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lldap_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16320fe64a069bf50594d08a8a7bb15052b6d74b73fc76fd6e4939d5fc455dd6
|
|
| MD5 |
53b3a09f26e4e3da705de14832ee0f83
|
|
| BLAKE2b-256 |
2ac4e717afc3e104159b9fe9727e9ac5337df3f38a3ed6809f862f6a4fa483cc
|
Provenance
The following attestation bundles were made for lldap_py-0.2.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on luca2618/lldap-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lldap_py-0.2.0-py3-none-any.whl -
Subject digest:
16320fe64a069bf50594d08a8a7bb15052b6d74b73fc76fd6e4939d5fc455dd6 - Sigstore transparency entry: 924292956
- Sigstore integration time:
-
Permalink:
luca2618/lldap-py@a8d33ef83a184c500a738eced52187f023a57228 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/luca2618
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@a8d33ef83a184c500a738eced52187f023a57228 -
Trigger Event:
workflow_dispatch
-
Statement type: