Skip to content

Commit 7b12bfa

Browse files
committed
Enforced HS256 algorithm in JWT decoding tests
1 parent 644d1bb commit 7b12bfa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def test_get_manual_ident_url(self):
656656

657657
token = path_segments[3]
658658

659-
data = jwt.decode(token, self.lp.shared_secret)
659+
data = jwt.decode(token, self.lp.shared_secret, algorithms=['HS256'])
660660

661661
self.assertEqual(data, {
662662
'back': u'http://example.com/news?id=10&emoji=\U0001f604',
@@ -669,7 +669,7 @@ def test_get_manual_ident_token(self):
669669
article_ids = ['aid≠1', b'aid\xe2\x89\xa02']
670670

671671
token = self.lp._get_manual_ident_token(article_url, article_ids)
672-
data = jwt.decode(token, self.lp.shared_secret)
672+
data = jwt.decode(token, self.lp.shared_secret, algorithms=['HS256'])
673673

674674
self.assertEqual(data, {
675675
'back': u'http://example.com/news?id=10&emoji=\U0001f604',
@@ -682,7 +682,7 @@ def test_get_manual_ident_token_muid(self):
682682
muid = u'😄'
683683

684684
token = self.lp._get_manual_ident_token(article_url, article_ids, muid=muid)
685-
data = jwt.decode(token, self.lp.shared_secret)
685+
data = jwt.decode(token, self.lp.shared_secret, algorithms=['HS256'])
686686

687687
self.assertEqual(data, {
688688
'back': 'http://example.com/news',

0 commit comments

Comments
 (0)