[Twisted-Python] ldaptor based LDAP server

Hi, I am looking for a Python barebones for a simple LDAP server project. It does not have to be Twisted based, but it would be wonderful if it is. I need a very simple server which is listening on some port and accepts following LDAP messages: -bind -search -unbind There are not going to be a actual LDAP database backend. All what happens is parsing above and reply with some simple content based on the some parameters from the request. I am just wondering with using ldaptor's protocol components I could easily come up with such a server? What do you think, would it be feasible with that? Thanks in advance, AndyL

Andrzej Leszczynski wrote:
Well, ldaptor/protocols/ldap/ldapserver.py is for you then.
If you want to reuse ldaptor search logic, search filter handling, etc, subclass LDAPServer and provide an IConnectedLDAPEntry adapter from the subclass to something that implements the actual data storage. That way, you get to use ldaptor's implementation of search etc; you just provide a tree-like data structure of LDAP entries. If you want full control of everything, and are willing to really implement bind,search&unbind yourself pretty much from scratch, subclass BaseLDAPServer and provide methods handle_LDAPBindRequest handle_LDAPSearchRequest handle_LDAPUnbindRequest see LDAPServer for hints on that.

Andrzej Leszczynski wrote:
Well, ldaptor/protocols/ldap/ldapserver.py is for you then.
If you want to reuse ldaptor search logic, search filter handling, etc, subclass LDAPServer and provide an IConnectedLDAPEntry adapter from the subclass to something that implements the actual data storage. That way, you get to use ldaptor's implementation of search etc; you just provide a tree-like data structure of LDAP entries. If you want full control of everything, and are willing to really implement bind,search&unbind yourself pretty much from scratch, subclass BaseLDAPServer and provide methods handle_LDAPBindRequest handle_LDAPSearchRequest handle_LDAPUnbindRequest see LDAPServer for hints on that.
participants (2)
-
Andrzej Leszczynski
-
Tommi Virtanen