[python3-ldap] Python3-ldap 0.9.6 released

python3ldap python3ldap at gmail.com
Sat Nov 1 10:57:57 CET 2014


Hello,
I've released version 0.9.6 of python3-ldap. It includes two new
features, some enanchement for Active Directory and a bunch of bug
fixes.

The new features are "offline" schemas and json serialization for
server and searches.
Now you can save the dsa info and schema info in a json string or file
and use it later to recreate a server object with the same features.
This is useful when the ldap server is not returning the schema or dsa
info and is required by the RFCs that state that the client must not
send operation with attributes or syntaxes not know to the server.
To accomplish this you can use the server.info.to_json(),
server.info.to_file(), server.schema.to_json() and
server.schema.to_file() to have the dsa info and the schema info in a
json format. The library strives for keep the information in json
consistent with the representation in the original format of binary
data received by the server, but must reformat binary attributes to a
b64encoded format for saving it a string or a file. This reformatting
should be trasparent to you, and independent from the python version
(python 2 or 3 generated json files are interchangeable).

You can also load a JSON serialized server definition with the
Server.from_json() and Server.from_file() methods. The real server
must anyway exist or you get an address exception. The dsa info will
be updated with real info from server while the schema will remain the
one you defined.

I've included the new package ldap3.protocol.schemas with some ldap
definition from Novell eDirectory, Active Directory and Openldap
(schema are gotten from a fresh installation), more schema will
probably come.

This machinery (even if it is supposed to exist by the LDAP RFCs) is
not really useful (at least this is for me) but it's helpful for the
"mocking" strategy I plan to include in the next release. It should
let you to perform tests without any real ldap server (as with
mockldap).

Json serialization for response search let you have a fast way to save
entries from responses in a json form. You have now the
response_to_json() and response_to_file() in the Connection object
that let you sve the entries from a search operation. You can specify
the raw=True parameter to include the raw attributes from the
response. Binary attributes are b64encoded or properly formatted is
their syntax is known.

I've added some default formatters for Active Directory syntaxes. Now
the date attributes are formatted to a datetime object and the sid and
guid are properly converted as specified in Microsoft documentation.

I apologize for the outdated documentation, I plan to have new docs soon.

This is the changelog for 0.9.6:
* 0.9.6 2014.11.01
    - New feature 'offline schema' to let the client have knowledge of
schema and DSA info even if not returned by the server
    - Offline schema for Novell eDirectory 8.8.8
    - Offline schema for Microsoft Active Directory 2012 R2
    - Offline schema for slapd 2.4 (Openldap)
    - Added server.info.to_json() and server.info.to_file to JSON
serialize schema and info from Server object
    - Added Server.from_json() and Server.from_file() to create a
Server object from a JSON definition
    - Added response_to_json() and response_to_file() to Connection
object to serialize search response entries in JSON as a string or as
a file
    - New exception hierarchy LDAPConfigurationError includes library
configuration exceptions
    - New exception LDAPInvalidConfigurationDefinitionError
    - Dsa info and schema are not read twice when binding (thanks phobie)
    - LDAPStartTLSError exception is merged with exception raised from
ssl packaged
    - Digest-MD5 SASL authentication accepts directives with list
attributes (thanks John)
    - Fixed caseInsensitiveDictionary for keys() and values() methods
    - Fixed matching of certificate name in ssl with Python2
    - Attributes names and formatters are checked even if schema is
not read by the server
    - Fixed fractional time when parsing generalized time
    - Specific decoder for Active Directory ObjectGuid and ObjectSid
    - Added additional checking for unicode in Python 2
    - Tested against python 3.4.2
    - Updated setuptools to 7.0

Bye,
Giovanni


More information about the python3-ldap mailing list