Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #30 from scality/bugfix/EVE-1165-restore-ui-auth
Browse files Browse the repository at this point in the history
EVE-1165 only decode object when needed
  • Loading branch information
tcarmet committed Jul 19, 2021
2 parents 79426c0 + ffaf862 commit fa5fef2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eve/patch/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.

from urllib.parse import parse_qs

import buildbot
import requests
from buildbot.www import resource
Expand Down Expand Up @@ -60,9 +62,12 @@ def thd():


def createSessionFromToken(self, token):
access_token = token['access_token']
if isinstance(access_token, bytes):
access_token = access_token.decode('utf-8')
s = requests.Session()
s.headers = {
'Authorization': 'token ' + token['access_token'].decode('utf-8'),
'Authorization': 'token ' + access_token,
'User-Agent': 'buildbot/{}'.format(buildbot.version),
}
s.verify = self.sslVerify
Expand Down

0 comments on commit fa5fef2

Please sign in to comment.