Skip to content

Commit

Permalink
Fix test failures in auth-backends on latest version of pyjwt (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Jan 26, 2021
1 parent f3986a5 commit 30ba876
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -14,6 +14,14 @@ Unreleased

*

[3.1.1] - 2021-01-25
--------------------

Changed
~~~~~

* Fixed pyjwt issue.


[3.1.0] - 2020-05-08
--------------------
Expand Down
2 changes: 1 addition & 1 deletion auth_backends/__init__.py
Expand Up @@ -3,4 +3,4 @@
These package is designed to be used primarily with Open edX Django projects, but should be compatible with non-edX
projects as well.
"""
__version__ = '3.3.0' # pragma: no cover
__version__ = '3.3.1' # pragma: no cover
2 changes: 1 addition & 1 deletion auth_backends/backends.py
Expand Up @@ -100,7 +100,7 @@ def auth_complete(self, *args, **kwargs):
return user

def user_data(self, access_token, *args, **kwargs):
decoded_access_token = jwt.decode(access_token, verify=False)
decoded_access_token = jwt.decode(access_token, options={"verify_signature": False})

keys = list(self.CLAIMS_TO_DETAILS_KEY_MAP.keys()) + ['administrator', 'superuser']
user_data = {key: decoded_access_token[key] for key in keys if key in decoded_access_token}
Expand Down
8 changes: 3 additions & 5 deletions requirements/base.txt
Expand Up @@ -18,7 +18,7 @@ defusedxml==0.6.0
# social-auth-core
django==2.2.17
# via
# -c requirements/constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
idna==2.10
# via requests
Expand All @@ -28,9 +28,8 @@ oauthlib==3.1.0
# social-auth-core
pycparser==2.20
# via cffi
pyjwt==1.7.1
pyjwt==2.0.1
# via
# -c requirements/constraints.txt
# -r requirements/base.in
# social-auth-core
python3-openid==3.2.0
Expand All @@ -48,10 +47,9 @@ six==1.15.0
# -r requirements/base.in
# cryptography
# social-auth-app-django
# social-auth-core
social-auth-app-django==4.0.0
# via -r requirements/base.in
social-auth-core==4.0.2
social-auth-core==4.0.3
# via
# -r requirements/base.in
# social-auth-app-django
Expand Down
4 changes: 2 additions & 2 deletions requirements/ci.txt
Expand Up @@ -40,11 +40,11 @@ toml==0.10.2
# via tox
tox-battery==0.6.1
# via -r requirements/ci.in
tox==3.21.0
tox==3.21.2
# via
# -r requirements/ci.in
# tox-battery
urllib3==1.26.2
# via requests
virtualenv==20.3.0
virtualenv==20.4.0
# via tox
6 changes: 2 additions & 4 deletions requirements/constraints.txt
Expand Up @@ -8,8 +8,6 @@
# pin when possible. Writing an issue against the offending project and
# linking to it here is good.

# stay on LTS
Django<2.3

# Test fails on newer versions with `It is required that you pass in a value for the "algorithms" argument when calling decode()`
pyjwt<2.0
# This file contains all common constraints for edx-repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
14 changes: 6 additions & 8 deletions requirements/dev.txt
Expand Up @@ -71,7 +71,7 @@ distlib==0.3.1
# virtualenv
django==2.2.17
# via
# -c requirements/constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/test.txt
edx-lint==1.6
# via -r requirements/test.txt
Expand Down Expand Up @@ -149,9 +149,8 @@ pycryptodomex==3.9.9
# pyjwkest
pyjwkest==1.4.2
# via -r requirements/test.txt
pyjwt==1.7.1
pyjwt==2.0.1
# via
# -c requirements/constraints.txt
# -r requirements/test.txt
# social-auth-core
pylint-celery==0.3
Expand Down Expand Up @@ -179,7 +178,7 @@ pyparsing==2.4.7
# -r requirements/ci.txt
# -r requirements/test.txt
# packaging
pytest-cov==2.10.1
pytest-cov==2.11.1
# via -r requirements/test.txt
pytest-django==4.1.0
# via -r requirements/test.txt
Expand Down Expand Up @@ -217,13 +216,12 @@ six==1.15.0
# edx-lint
# pyjwkest
# social-auth-app-django
# social-auth-core
# tox
# unittest2
# virtualenv
social-auth-app-django==4.0.0
# via -r requirements/test.txt
social-auth-core==4.0.2
social-auth-core==4.0.3
# via
# -r requirements/test.txt
# social-auth-app-django
Expand All @@ -240,7 +238,7 @@ toml==0.10.2
# tox
tox-battery==0.6.1
# via -r requirements/ci.txt
tox==3.21.0
tox==3.21.2
# via
# -r requirements/ci.txt
# -r requirements/test.txt
Expand All @@ -256,7 +254,7 @@ urllib3==1.26.2
# -r requirements/ci.txt
# -r requirements/test.txt
# requests
virtualenv==20.3.0
virtualenv==20.4.0
# via
# -r requirements/ci.txt
# -r requirements/test.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Expand Up @@ -10,5 +10,5 @@ wheel==0.36.2
# The following packages are considered to be unsafe in a requirements file:
pip==20.3.3
# via -r requirements/pip.in
setuptools==51.1.2
setuptools==51.3.3
# via -r requirements/pip.in
14 changes: 6 additions & 8 deletions requirements/test.txt
Expand Up @@ -48,7 +48,7 @@ defusedxml==0.6.0
distlib==0.3.1
# via virtualenv
# via
# -c requirements/constraints.txt
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.txt
edx-lint==1.6
# via -r requirements/test.in
Expand Down Expand Up @@ -101,9 +101,8 @@ pycryptodomex==3.9.9
# via pyjwkest
pyjwkest==1.4.2
# via -r requirements/test.in
pyjwt==1.7.1
pyjwt==2.0.1
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# social-auth-core
pylint-celery==0.3
Expand All @@ -122,7 +121,7 @@ pylint==2.6.0
# pylint-plugin-utils
pyparsing==2.4.7
# via packaging
pytest-cov==2.10.1
pytest-cov==2.11.1
# via -r requirements/test.in
pytest-django==4.1.0
# via -r requirements/test.in
Expand Down Expand Up @@ -156,13 +155,12 @@ six==1.15.0
# edx-lint
# pyjwkest
# social-auth-app-django
# social-auth-core
# tox
# unittest2
# virtualenv
social-auth-app-django==4.0.0
# via -r requirements/base.txt
social-auth-core==4.0.2
social-auth-core==4.0.3
# via
# -r requirements/base.txt
# social-auth-app-django
Expand All @@ -175,7 +173,7 @@ toml==0.10.2
# pylint
# pytest
# tox
tox==3.21.0
tox==3.21.2
# via -r requirements/test.in
traceback2==1.4.0
# via unittest2
Expand All @@ -185,7 +183,7 @@ urllib3==1.26.2
# via
# -r requirements/base.txt
# requests
virtualenv==20.3.0
virtualenv==20.4.0
# via tox
wrapt==1.12.1
# via astroid

0 comments on commit 30ba876

Please sign in to comment.