Fix encoding issues with LDAP/AD on Python 3.x

Review Request #11424 — Created Feb. 1, 2021 and submitted

david
Review Board
release-4.0.x
reviewboard

A user reported encoding errors in their logs when attempting to log in
a new user when connected to LDAP. The issue here was that data returned
from ldap was bytes, but we were attempting to split it using a
unicode splitter. According to the ldap documentation, field names are
returned as the text type, but attribute values will be bytestrings. The
documentation is a unclear in that it also claims that "text values"
will be the unicode type. In order to accomodate potentially different
behavior across Python versions, all values have been wrapped in
force_text. The unit tests have been updated to supply the expected
(bytes) types for values.

Ran unit tests on Python 2.7 and 3.8.

Summary
Fix encoding issues with LDAP/AD on Python 3.x
Description From Last Updated

Swap these (alphabetical order).

chipx86chipx86
chipx86
  1. 
      
  2. reviewboard/accounts/backends/ad.py (Diff revision 1)
     
     
     

    Swap these (alphabetical order).

  3. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (0edccb2)
Loading...