Giter Site home page Giter Site logo

aioldap3's Introduction

aioldap

image

image

Code coverage

Documentation Status

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

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.

aioldap3's People

Contributors

terrycain avatar pyup-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.