Bug 53652 - PermissionError with correct password
PermissionError with correct password
Status: CLOSED WORKSFORME
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 5.0
Other All
: P5 normal (vote)
: UCS@school 5.0 v1
Assigned To: Felix Botner
Florian Best
:
Depends on: 48137
Blocks: 49051
  Show dependency treegraph
 
Reported: 2021-08-12 15:01 CEST by Florian Best
Modified: 2022-03-25 09:34 CET (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 2 Felix Botner univentionstaff 2021-09-01 10:08:13 CEST
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?
Comment 3 Florian Best univentionstaff 2021-09-01 10:17:18 CEST
(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.