commit 935fd60326feafd767993475a48b9f5973c828db
Author: John Dennis <email address hidden>
Date: Fri May 2 14:14:20 2014 -0400
Encode/Decode LDAP parameters to/from UTF-8
The python-ldap API only accepts UTF-8 encoded strings therefore any
unicode values must be encoded to UTF-8 prior to passing to
python-ldap and conversely UTF-8 encoded strings returned from
python-ldap need to be decoded back from UTF-8 into unicode.
Need to use unicode() rather than str() to properly handle non-ascii
characters, but to be PY2/PY3 compatible use six.text_type.
Very few of the ldap tests were using non-ascii values, in fact
non-ascii values were restricted to only specific tests that
had 'unicode' in their test name. This is very weak test coverage.
Replace all occurances of 'fake', the standard string
used in the tests for test value with 'fäké' where the a has an
umlaut and the e has a diacritical. Visually they look almost the
same but will trigger the type of encoding exceptions we've seen
in the past.
Reviewed: https:/ /review. openstack. org/91883 /git.openstack. org/cgit/ openstack/ keystone/ commit/ ?id=935fd60326f eafd767993475a4 8b9f5973c828db
Committed: https:/
Submitter: Jenkins
Branch: stable/icehouse
commit 935fd60326feafd 767993475a48b9f 5973c828db
Author: John Dennis <email address hidden>
Date: Fri May 2 14:14:20 2014 -0400
Encode/Decode LDAP parameters to/from UTF-8
The python-ldap API only accepts UTF-8 encoded strings therefore any
unicode values must be encoded to UTF-8 prior to passing to
python-ldap and conversely UTF-8 encoded strings returned from
python-ldap need to be decoded back from UTF-8 into unicode.
Need to use unicode() rather than str() to properly handle non-ascii
characters, but to be PY2/PY3 compatible use six.text_type.
Very few of the ldap tests were using non-ascii values, in fact
non-ascii values were restricted to only specific tests that
had 'unicode' in their test name. This is very weak test coverage.
Replace all occurances of 'fake', the standard string
used in the tests for test value with 'fäké' where the a has an
umlaut and the e has a diacritical. Visually they look almost the
same but will trigger the type of encoding exceptions we've seen
in the past.
This is the minimal backport for icehouse from the following /review. openstack. org/#/c/ 82396/ /review. openstack. org/#/c/ 82398/ /review. openstack. org/#/c/ 82399/
master commits:
https:/
https:/
https:/
Closes-Bug: #1172106
Change-Id: I6b328dfc843545 7a8d7ff16320f3d 869cfa1043c