From a403f4bcc4fc41caf0d76bb99c27b34cc005b209 Mon Sep 17 00:00:00 2001 From: Krish Tyagi Date: Thu, 11 Sep 2025 17:54:17 +0530 Subject: [PATCH] chore!: removing of pyjwkest dependency from edx-platform (#37159) --- .../core/djangoapps/oauth_dispatch/docs/README.rst | 8 ++++---- requirements/edx/base.txt | 7 ------- requirements/edx/development.txt | 12 ------------ requirements/edx/doc.txt | 9 --------- requirements/edx/kernel.in | 4 +--- requirements/edx/testing.txt | 9 --------- 6 files changed, 5 insertions(+), 44 deletions(-) diff --git a/openedx/core/djangoapps/oauth_dispatch/docs/README.rst b/openedx/core/djangoapps/oauth_dispatch/docs/README.rst index 6aa9e344dc..8aa343b864 100644 --- a/openedx/core/djangoapps/oauth_dispatch/docs/README.rst +++ b/openedx/core/djangoapps/oauth_dispatch/docs/README.rst @@ -23,15 +23,15 @@ Provider code * Its `Access Token View`_ returns JWTs as access tokens when a JWT token_type is requested. - * It uses an edX custom JwtBuilder_ implementation to create the JWT. + * It uses the edX custom `create_jwt method`_ to create the JWT. -* The JwtBuilder_ uses the pyjwkest_ library for implementation of `JSON Web Signature (JWS)`_ and other crypto to build and sign JWT tokens. + * The `create_jwt method`_ uses `PyJWK from PyJWT`_ library for implementation of `JSON Web Signature (JWS)`_ and other crypto to build and sign JWT tokens. .. _oauth_dispatch: https://github.com/openedx/edx-platform/tree/master/openedx/core/djangoapps/oauth_dispatch .. _validator module: https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/oauth_dispatch/dot_overrides/validators.py .. _Access Token View: https://github.com/openedx/edx-platform/blob/d21a09828072504bc97a2e05883c1241e3a35da9/openedx/core/djangoapps/oauth_dispatch/views.py#L89 -.. _JwtBuilder: https://github.com/openedx/edx-platform/blob/d21a09828072504bc97a2e05883c1241e3a35da9/openedx/core/lib/token_utils.py#L15 -.. _pyjwkest: https://github.com/IdentityPython/pyjwkest +.. _create_jwt method: https://github.com/openedx/edx-platform/blob/master/openedx/core/lib/jwt.py#L13 +.. _PyJWK from PyJWT: https://github.com/jpadilla/pyjwt/blob/ac69d3657f07d78894aea27c6351aee60eaec6ef/jwt/api_jwk.py#L18 .. _JSON Web Signature (JWS): https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41 Clients & REST API Clients code diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 5e24c1fd27..c5351959cd 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -598,8 +598,6 @@ fs-s3fs==1.1.1 # via # -r requirements/edx/kernel.in # openedx-django-pyfs -future==1.0.0 - # via pyjwkest geoip2==5.1.0 # via -r requirements/edx/kernel.in glob2==0.7 @@ -927,13 +925,10 @@ pycryptodomex==3.23.0 # -r requirements/edx/kernel.in # edx-proctoring # lti-consumer-xblock - # pyjwkest pydantic==2.11.7 # via camel-converter pydantic-core==2.33.2 # via pydantic -pyjwkest==1.4.2 - # via -r requirements/edx/kernel.in pyjwt[crypto]==2.10.1 # via # -r requirements/edx/kernel.in @@ -1063,7 +1058,6 @@ requests==2.32.5 # openai # openedx-forum # optimizely-sdk - # pyjwkest # pylti1p3 # python-swiftclient # requests-oauthlib @@ -1121,7 +1115,6 @@ six==1.17.0 # fs # fs-s3fs # html5lib - # pyjwkest # python-dateutil slumber==0.7.1 # via diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index c3e3d13be9..cf3f813598 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -944,11 +944,6 @@ fs-s3fs==1.1.1 # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt # openedx-django-pyfs -future==1.0.0 - # via - # -r requirements/edx/doc.txt - # -r requirements/edx/testing.txt - # pyjwkest geoip2==5.1.0 # via # -r requirements/edx/doc.txt @@ -1567,7 +1562,6 @@ pycryptodomex==3.23.0 # -r requirements/edx/testing.txt # edx-proctoring # lti-consumer-xblock - # pyjwkest pydantic==2.11.7 # via # -r requirements/edx/doc.txt @@ -1592,10 +1586,6 @@ pygments==2.19.2 # pydata-sphinx-theme # sphinx # sphinx-mdinclude -pyjwkest==1.4.2 - # via - # -r requirements/edx/doc.txt - # -r requirements/edx/testing.txt pyjwt[crypto]==2.10.1 # via # -r requirements/edx/doc.txt @@ -1844,7 +1834,6 @@ requests==2.32.5 # openedx-forum # optimizely-sdk # pact-python - # pyjwkest # pylti1p3 # python-swiftclient # requests-oauthlib @@ -1936,7 +1925,6 @@ six==1.17.0 # html5lib # libsass # pact-python - # pyjwkest # python-dateutil # sphinxcontrib-httpdomain slumber==0.7.1 diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index a9a174a1ab..a82a2dabfb 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -694,10 +694,6 @@ fs-s3fs==1.1.1 # via # -r requirements/edx/base.txt # openedx-django-pyfs -future==1.0.0 - # via - # -r requirements/edx/base.txt - # pyjwkest geoip2==5.1.0 # via -r requirements/edx/base.txt gitdb==4.0.12 @@ -1127,7 +1123,6 @@ pycryptodomex==3.23.0 # -r requirements/edx/base.txt # edx-proctoring # lti-consumer-xblock - # pyjwkest pydantic==2.11.7 # via # -r requirements/edx/base.txt @@ -1144,8 +1139,6 @@ pygments==2.19.2 # pydata-sphinx-theme # sphinx # sphinx-mdinclude -pyjwkest==1.4.2 - # via -r requirements/edx/base.txt pyjwt[crypto]==2.10.1 # via # -r requirements/edx/base.txt @@ -1295,7 +1288,6 @@ requests==2.32.5 # openai # openedx-forum # optimizely-sdk - # pyjwkest # pylti1p3 # python-swiftclient # requests-oauthlib @@ -1367,7 +1359,6 @@ six==1.17.0 # fs # fs-s3fs # html5lib - # pyjwkest # python-dateutil # sphinxcontrib-httpdomain slumber==0.7.1 diff --git a/requirements/edx/kernel.in b/requirements/edx/kernel.in index f92b110a06..043c8f4794 100644 --- a/requirements/edx/kernel.in +++ b/requirements/edx/kernel.in @@ -104,7 +104,7 @@ jsonfield # Django model field for validated JSON; use laboratory # Library for testing that code refactors/infrastructure changes produce identical results importlib_metadata # Used to access entry_points in i18n_api plugin lxml[html_clean] # XML parser -lti-consumer-xblock>=7.3.0 +lti-consumer-xblock>=9.14.2 mako # Primary template language used for server-side page rendering Markdown # Convert text markup to HTML; used in capa problems, forums, and course wikis meilisearch # Library to access Meilisearch search engine (will replace ElasticSearch) @@ -128,8 +128,6 @@ Pillow # Image manipulation library; used for cours psutil # Library for retrieving information on running processes and system utilization pycountry pycryptodomex -pyjwkest -# TODO Replace PyJWT usage with pyjwkest # PyJWT 1.6.3 contains PyJWTError, which is required by Apple auth in social-auth-core PyJWT>=1.6.3 pylti1p3 # Required by content_libraries core library to support LTI 1.3 launches diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 3e5bb17486..0cf19bade5 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -729,10 +729,6 @@ fs-s3fs==1.1.1 # via # -r requirements/edx/base.txt # openedx-django-pyfs -future==1.0.0 - # via - # -r requirements/edx/base.txt - # pyjwkest geoip2==5.1.0 # via -r requirements/edx/base.txt glob2==0.7 @@ -1192,7 +1188,6 @@ pycryptodomex==3.23.0 # -r requirements/edx/base.txt # edx-proctoring # lti-consumer-xblock - # pyjwkest pydantic==2.11.7 # via # -r requirements/edx/base.txt @@ -1206,8 +1201,6 @@ pygments==2.19.2 # via # -r requirements/edx/coverage.txt # diff-cover -pyjwkest==1.4.2 - # via -r requirements/edx/base.txt pyjwt[crypto]==2.10.1 # via # -r requirements/edx/base.txt @@ -1405,7 +1398,6 @@ requests==2.32.5 # openedx-forum # optimizely-sdk # pact-python - # pyjwkest # pylti1p3 # python-swiftclient # requests-oauthlib @@ -1478,7 +1470,6 @@ six==1.17.0 # fs-s3fs # html5lib # pact-python - # pyjwkest # python-dateutil slumber==0.7.1 # via