Univention Bugzilla – Bug 53652
PermissionError with correct password
Last modified: 2022-03-25 09:34:30 CET
Works in my test setup, reverted workaround. What i always see is [2021-08-23 12:31:40 +0200] [13715] [DEBUG] Couldn't get username: 'utf-8' codec can't decode byte 0xa7 in position 21: invalid start byte [2021-08-23 12:31:41 +0200] [13714] [DEBUG] GET /v1/imports/users/1/ in /var/log/univention/ucs-school-import/gunicorn_error.log, but i think that is just an issue with the logging in gunicorn our http api client uses requests for the communication, and here the password is latin-1 requests/vi auth.py if isinstance(password, str): password = password.encode('latin1') the api server correctly decodes this: # Header encoding (see RFC5987) HTTP_HEADER_ENCODING = 'iso-8859-1' /usr/lib/python3/dist-packages/rest_framework/authentication.py auth_parts = base64.b64decode(auth[1]).decode(HTTP_HEADER_ENCODING).partition(':') but gunicron uses utf-8. /usr/lib/python3/dist-packages/gunicorn/glogging.py auth = base64.b64decode(auth[1].strip().encode('utf-8')) Which results in this error during the logging. Not sure what to do, ignoring or fix?
(In reply to Felix Botner from comment #2) All right, then this was an interim problem due to Bug #53451. > Which results in this error during the logging. Not sure what to do, > ignoring or fix? Ignoring. it's only logging.
OK: changes reverted OK: test case passes again except for https://jenkins.knut.univention.de:8181/job/UCSschool-5.0/job/Upgrade%20Singleserver/lastCompletedBuild/Config=s4,TestGroup=import1/testReport/90_ucsschool/302_http-api_class_column_no_school/master206/ - but this is another reason.