feat!: upgrade pyjwt to version 2.1.0

This commit is contained in:
Soban Javed
2021-08-17 18:45:15 +05:00
committed by Awais Qureshi
parent a35fa080b3
commit 56d12bf230
6 changed files with 84 additions and 11 deletions

View File

@@ -46,8 +46,10 @@ class AccessTokenMixin:
algorithms=[settings.JWT_AUTH['JWT_ALGORITHM']],
audience=audience,
issuer=issuer,
verify_expiration=verify_expiration,
options={'verify_signature': False},
options={
'verify_signature': False,
"verify_exp": verify_expiration
},
)
# Note that if we expect the claims to have expired

View File

@@ -46,7 +46,7 @@ class TestCourseUserDiscount(ModuleStoreTestCase):
assert expected_payload['discount_applicable'] == response.data['discount_applicable']
# make sure that the response matches the expected response
response_payload = jwt.decode(response.data['jwt'], verify=False)
response_payload = jwt.decode(response.data['jwt'], options={"verify_signature": False})
assert all(item in list(response_payload.items()) for item in expected_payload.items())
def test_course_user_discount_no_user(self):