]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/restful: Decode the output of b64decode 26712/head
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 1 Mar 2019 04:33:58 +0000 (14:33 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Fri, 1 Mar 2019 23:20:19 +0000 (09:20 +1000)
Need to decode the b64decode output before calling split.

b64decode("YWRtaW46NzYxMmJlMTEtYjJmZS00NTA5LTlhY2ItMjYzZGQwZjJmMjUx")
b'admin:7612be11-b2fe-4509-9acb-263dd0f2f251'
b64decode("YWRtaW46NzYxMmJlMTEtYjJmZS00NTA5LTlhY2ItMjYzZGQwZjJmMjUx").decode()
'admin:7612be11-b2fe-4509-9acb-263dd0f2f251'

Fixes: http://tracker.ceph.com/issues/38522
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/pybind/mgr/restful/decorators.py

index 03a9448298c1c19baf5b3b2d73ac087a115e8955..abf36e339ab5fbc4a24e55ec0b037213145d0c27 100644 (file)
@@ -18,7 +18,7 @@ def auth(f):
             response.headers['WWW-Authenticate'] = 'Basic realm="Login Required"'
             return {'message': 'auth: No HTTP username/password'}
 
-        username, password = b64decode(request.authorization[1]).split(':')
+        username, password = b64decode(request.authorization[1]).decode('utf-8').split(':')
 
         # Check that the username exists
         if username not in context.instance.keys: