[python3-ldap] Python3-ldap 0.7.0 released

python3ldap python3ldap at gmail.com
Thu Dec 12 19:26:07 CET 2013


Hello everybody,
I've release the 0.7.0 version of python3-ldap. The main feature of
this release is support for LDIF as per rfc 2849.

LDIF is a data interchange format for LDAP. It is defined in RFC 2849
in two different flavours: ldif-content and ldif-change. ldif-content
is used to describe DIT entries in an ASCII stream (i.e. a file),
while ldif-change is used to describe Add, Delete, Modfify and
ModifyDn operations. These two format have different purposes and
cannot be mixed in the same stream. If the dn of the entry or an
attribute contains any unicode character the value must be base64
encoded, as specified in RFC 2849.

Python3-ldap is compliant to the latest LDIF format (version: 1). You
can use the ldif-content flavour with any search result:

...
result = c.search('o=test','(cn=test-ldif*)',
SEARCH_SCOPE_WHOLE_SUBTREE, attributes = ['sn', 'objectClass'])  #
request a few object from the ldap server
ldifStream = c.responseToLDIF()
...

ldifStream will contain:

version: 1
dn: cn=test-ldif-1,o=test
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: Person
objectClass: ndsLoginProperties
objectClass: Top
sn: test-ldif-1

dn: cn=test-ldif-2,o=test
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: Person
objectClass: ndsLoginProperties
objectClass: Top
sn:: dGVzdC1sZGlmLTItw6DDssO5


# total number of entries: 2

you can even request a ldif-content for a response you saved early:

...
   result1 = c.search('o=test','(cn=test-ldif*)',
SEARCH_SCOPE_WHOLE_SUBTREE, attributes = ['sn', 'objectClass'])  #
request a few object from the ldap server
   result2 = c.search('o=test','(!(cn=test-ldif*))',
SEARCH_SCOPE_WHOLE_SUBTREE, attributes = ['sn', 'objectClass'])
   ldifStream = c.responseToLDIF(result1)
   ...

ldifStream will contain the LDIF representation of the result1 entries.

Now I'm working on the ldif-change flavour of the rfc.

Here I include the last changelog because I didn't announce some minor
releases on this mailing list:

CHANGELOG:

0.7.0 - 2013.12.12

Added support for LDIF as per rfc 2849
Added ldif-content compliant search responses
Added exception when using autoBind if connection is not successful

0.6.7 - 2013.12.03

Fixed exception when DSA is not willing to return rootDSE and schema info

0.6.6 - 2013.11.13

Added parameters to tests suite

0.6.5 - 2013.11.05

Modified rawAttributes decoding, now null (empty) values are returned
even if invalid in protocol


Have fun,
gc


More information about the python3-ldap mailing list