Update pyjwt version to >=2.0.0,<3.0.0

Pyjwt recently made a 2.0 release. This release is not compatible with
the 1.x series code. We fix the registry to be compat with pyjwt 2.x and
then exclude 1.x.

More details here:
  https://pyjwt.readthedocs.io/en/stable/changelog.html#jwt-encode-return-type

Change-Id: I5c8e6fa0bb593efc70d57413b6d3274883a5a9b5
This commit is contained in:
Clark Boylan 2021-02-01 10:45:04 -08:00
parent ea4b756f70
commit e155fa9383
2 changed files with 2 additions and 3 deletions

View File

@ -7,4 +7,4 @@ requests
openstacksdk
python-dateutil
rehash
pyjwt
pyjwt>=2.0.0,<3.0.0

View File

@ -128,8 +128,7 @@ class Authorization(cherrypy.Tool):
else:
self.unauthorized()
self.log.debug('Generate %s token', level)
token = jwt.encode({'level': level}, 'secret',
algorithm='HS256').decode('utf8')
token = jwt.encode({'level': level}, 'secret', algorithm='HS256')
return {'token': token,
'access_token': token}