Modernize the Active Directory backend.

Review Request #11356 — Created Dec. 30, 2020 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

The Active Directory backend is old, did not have adequate testing, and
didn't work right with a modern environment in 4.0 beta.

This change updates it for proper Python 3 compatibility. This is
largely done by turning off byte string mode in python-ldap, which
ensures all strings will be Unicode. This gets us a lot for free. As
part of this upgrade, we also make use of some utility functions for
building DNs, so that we don't have to worry about escaping content
correctly.

DNS discovery has been updated to use dnspython, instead of the old
PyDNS. We already depend on this in Djblets, for DMARC support.
Because of this, we no longer have to conditionally offer DNS discovery.

Logging has been updated to always include HTTP request information, for
easier debugging. Some logs have been improved as well.

Many new unit tests have been added, instrumenting all of the backend's
capabilities.

Unit tests pass on all versions of Python.

Commits

Files