Skip to main content

Async ldap library sorta based off ldap3

Project description

=======
aioldap
=======

.. image:: https://img.shields.io/pypi/v/aioldap.svg
:target: https://pypi.python.org/pypi/aioldap

.. image:: https://img.shields.io/travis/terrycain/aioldap.svg
:target: https://travis-ci.org/terrycain/aioldap

.. image:: https://codecov.io/gh/terrycain/aioldap/branch/master/graph/badge.svg
:target: https://codecov.io/gh/terrycain/aioldap
:alt: Code coverage

.. image:: https://readthedocs.org/projects/aioldap/badge/?version=latest
:target: https://aioldap.readthedocs.io
:alt: Documentation Status

.. image:: https://pyup.io/repos/github/terrycain/aioldap/shield.svg
:target: https://pyup.io/repos/github/terrycain/aioldap/
:alt: Updates

Not entirely ready, literally just started. Might shuffle things around a bit etc...

This was initially going to be a complete "from scratch" LDAP library for asyncio. Having used ldap3 for quite a
while I thought: wouldn't it be nice to have something ldap3-like but using normal asyncio. So I wrote this library which
is sort of based around ldap3, it uses ldap3's encoding and decoding functions and I just dealt with the actual packet
handoff. As as for why I made this, well because I can... and because I was bored.

I wouldn't quite call this production ready yet, and it could do with a bit of cleaning up but if anyone actually
finds this library useful, raise an issue with anything you have and I'll be happy to help out.

In its current form it only supports Python3.6 as I have an async generator in the code, am looking at making it
Python3.5 compatible too.

Documentation
-------------
Eventually will be on readthedocs


Example
-------

Simple example of using aioboto3 to put items into a dynamodb table

.. code-block:: python
conn = aioldap.LDAPConnection()
await conn.bind(
bind_dn=ldap_params['user'],
bind_pw=ldap_params['password'],
host=ldap_params['host'],
port=ldap_params['port']
)

dn = user_entry('modify', ldap_params['test_ou1'])
await conn.add(
dn=dn,
object_class='inetOrgPerson',
attributes={'description': 'some desc', 'cn': 'some_user', 'sn': 'some user', 'employeeType': ['type1', 'type2']}
)

await conn.modify(
dn=dn,
changes={
'sn': [('MODIFY_REPLACE', 'some other user')],
'employeeType': [
('MODIFY_ADD', 'type3'),
('MODIFY_DELETE', 'type1'),
]
}
)

# Now search for user
async for user in conn.search(dn, search_filter='(uid=*)', search_scope='BASE', attributes='*'):
assert user['dn'] == dn


Credits
-------

All of the credit goes to @cannatag who literally had done all of the hard work for me.



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aioldap-0.3.1.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioldap-0.3.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file aioldap-0.3.1.tar.gz.

File metadata

  • Download URL: aioldap-0.3.1.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aioldap-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ac4439db852e9f570e8b75a8a6d4411af899f7e7913c9000d17dd552f33e3b35
MD5 15f9fcfbc85188246c4004747e48f3f5
BLAKE2b-256 bc6948fb72f2411aae5d8cd33d4a052254224cc21e7638c80bacab4f879bbc60

See more details on using hashes here.

File details

Details for the file aioldap-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aioldap-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9de74e58534c0d5aa8b12b72c418acbd3f2f4794d8085dfca48b23e1947aa678
MD5 849da39ecff3ead288f3a9b5f1e090ab
BLAKE2b-256 75d63e71abd9fcfa4397f721a60bc6943b62a9dc3ce488e07bb46614ea297331

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page