Skip to content

A ldap object mapper for python, also containing a very minimal python ldap interface based on the openldap-libldap (work in progress!). By the way, this is ctypes-based! Do you see the blue bar on the right? ;)

License

LediKorsar/python-lmap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-lmap

This Python module contains two files: ldap.py and lmap.py. ldap.py contains a very small Python 3.3-compatible openldap libldap-interface based on ctypes (that means it does not need any compiled code to work). This interface, though it is extremely simple, supports the most common LDAP operations.

lmap.py is a (still work in progress) python object to LDAP mapper that supports all kinds of magic to make working with LDAP entries from python less of a pain. If you are going to use it, be careful because it might not (yet) behave as you would expect.

There are unit tests for both parts. In test_ldap.py you can find some code you may use to set up a temporary slapd (LDAP-server) for unit testing that will be automatically torn down after the tests.

Definition of "small"

  196 lmap/lmap.py
  377 total
          ***
  159 lmap/test_ldap.py
   81 lmap/test_lmap.py
  240 total

Performing SASL binds and ctypes problems

The LDAP driver now supports SASL binds, for example for Kerberos. The default is to use kerberos via GSSAPI, using an existing ticket after you ran kinit. You have to provide your Kerberos realm (this looks like a domain name). You may, however, also just pass username/realm/password into it and it will try to auth using those.

Contributing

If you like this code, fork it, send me a pull request ;)

About

A ldap object mapper for python, also containing a very minimal python ldap interface based on the openldap-libldap (work in progress!). By the way, this is ctypes-based! Do you see the blue bar on the right? ;)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published