Skip to content

Commit 90ff17d

Browse files
BotondDdajiajiAndrew-Chen-Wangjairhenrique
authored
Python310 (#1)
* Remove verify from jwt.decode() to follow PyJWT v2.2.0. (jazzband#472) * Fix test not to overwrite PyJWT.decode with PyJWS.decode. Co-authored-by: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> * Add support to python 3.10 Co-authored-by: Ajitomi Daisuke <dajiaji@gmail.com> Co-authored-by: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Co-authored-by: Jair Henrique <jair.henrique@gmail.com>
1 parent 7759aa8 commit 90ff17d

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
max-parallel: 5
1616
matrix:
17-
python-version: ['3.7', '3.8', '3.9']
17+
python-version: ['3.7', '3.8', '3.9', '3.10']
1818
django-version: ['2.2', '3.1', '3.2', 'main']
1919
drf-version: ['3.10', '3.11', '3.12']
2020
exclude:

rest_framework_simplejwt/backends.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def decode(self, token, verify=True):
9191
token,
9292
self.get_verifying_key(token),
9393
algorithms=[self.algorithm],
94-
verify=verify,
9594
audience=self.audience,
9695
issuer=self.issuer,
9796
leeway=self.leeway,

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
'Programming Language :: Python :: 3.7',
7979
'Programming Language :: Python :: 3.8',
8080
'Programming Language :: Python :: 3.9',
81+
'Programming Language :: Python :: 3.10',
8182
'Topic :: Internet :: WWW/HTTP',
8283
]
8384
)

tests/test_backends.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ def test_decode_when_algorithm_not_available(self):
276276

277277
pyjwt_without_rsa = PyJWS()
278278
pyjwt_without_rsa.unregister_algorithm('RS256')
279-
with patch.object(jwt, 'decode', new=pyjwt_without_rsa.decode):
279+
def _decode(jwt, key, algorithms, options, audience, issuer, leeway):
280+
return pyjwt_without_rsa.decode(jwt, key, algorithms, options)
281+
with patch.object(jwt, 'decode', new=_decode):
280282
with self.assertRaisesRegex(TokenBackendError, 'Invalid algorithm specified'):
281283
self.rsa_token_backend.decode(token)
282284

tox.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[tox]
22
envlist=
3-
py{37,38,39}-dj22-drf310-tests
4-
py{37,38,39}-dj{22,31,32}-drf{311,312}-tests
5-
py39-djmain-drf312-tests
3+
py{37,38,39,310}-dj22-drf310-tests
4+
py{37,38,39,310}-dj{22,31,32}-drf{311,312}-tests
5+
py{39,310}-djmain-drf312-tests
66
docs
77
lint
88

@@ -11,6 +11,7 @@ python=
1111
3.7: py37
1212
3.8: py38, docs, lint
1313
3.9: py39
14+
3.10: py310
1415

1516
[gh-actions:env]
1617
DJANGO=

0 commit comments

Comments
 (0)