Skip to content

Commit b8186c8

Browse files
authored
Bump pyjwt to 2.x (#127)
1 parent 03a8ca7 commit b8186c8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
from stream import __version__, __maintainer__, __email__, __license__
77
import sys
88

9-
tests_require = ["pytest==3.2.5", "unittest2", "pytest-cov", "python-dateutil"]
9+
tests_require = ["pytest", "unittest2", "pytest-cov", "python-dateutil"]
1010
ci_require = ["black", "flake8", "pytest-cov"]
1111

1212
long_description = open("README.md", "r").read()
1313

1414
install_requires = [
1515
"pycryptodomex>=3.8.1,<4",
1616
"requests>=2.3.0,<3",
17-
"pyjwt>=1.3.0,<1.8.0",
17+
"pyjwt>=2.0.0,<3",
1818
"pytz>=2019.3",
1919
]
2020

stream/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def create_user_token(self, user_id, **extra_data):
181181
payload = {"user_id": user_id}
182182
for k, v in extra_data.items():
183183
payload[k] = v
184-
return jwt.encode(payload, self.api_secret, algorithm="HS256").decode("utf-8")
184+
return jwt.encode(payload, self.api_secret, algorithm="HS256")
185185

186186
def create_jwt_token(self, resource, action, feed_id=None, user_id=None, **params):
187187
"""
@@ -193,7 +193,7 @@ def create_jwt_token(self, resource, action, feed_id=None, user_id=None, **param
193193
payload["feed_id"] = feed_id
194194
if user_id is not None:
195195
payload["user_id"] = user_id
196-
return jwt.encode(payload, self.api_secret).decode("utf-8")
196+
return jwt.encode(payload, self.api_secret, algorithm="HS256")
197197

198198
def _make_request(
199199
self,

0 commit comments

Comments
 (0)