Modernize the Active Directory backend.
Review Request #11356 — Created Dec. 30, 2020 and submitted
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
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
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
Unit tests pass on all versions of Python.