Skip to content

Commit 3282b95

Browse files
authored
Set algo in jwt decode for deprecation notice (#116)
JWT decode without an algorithm is deprecated and throws warning, so we set explicitly to silence warnings.
1 parent 2000000 commit 3282b95

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

stream/tests/test_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,10 @@ def test_token_retrieval(self):
376376
def test_user_session_token(self):
377377
client = stream.connect(self.c.api_key, self.c.api_secret)
378378
token = client.create_user_session_token("user")
379-
payload = jwt.decode(token, self.c.api_secret)
379+
payload = jwt.decode(token, self.c.api_secret, algorithms=["HS256"])
380380
self.assertEqual(payload["user_id"], "user")
381381
token = client.create_user_session_token("user", client="python", testing=True)
382-
payload = jwt.decode(token, self.c.api_secret)
382+
payload = jwt.decode(token, self.c.api_secret, algorithms=["HS256"])
383383
self.assertEqual(payload["client"], "python")
384384
self.assertEqual(payload["testing"], True)
385385

@@ -1069,7 +1069,9 @@ def test_create_email_redirect(self):
10691069
parsed_url = urlparse(redirect_url)
10701070
qs = parse_qs(parsed_url.query)
10711071

1072-
decoded = jwt.decode(qs["authorization"][0], self.c.api_secret)
1072+
decoded = jwt.decode(
1073+
qs["authorization"][0], self.c.api_secret, algorithms=["HS256"]
1074+
)
10731075

10741076
self.assertEqual(
10751077
decoded,

0 commit comments

Comments
 (0)