From ac979607b52e5af2db3d136789de121e4199911a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:21:06 +0000 Subject: [PATCH 1/2] chore(deps): bump pyjwt[crypto] from 2.8.0 to 2.9.0 Bumps [pyjwt[crypto]](https://github.com/jpadilla/pyjwt) from 2.8.0 to 2.9.0. - [Release notes](https://github.com/jpadilla/pyjwt/releases) - [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst) - [Commits](https://github.com/jpadilla/pyjwt/compare/2.8.0...2.9.0) --- updated-dependencies: - dependency-name: pyjwt[crypto] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements/main.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/main.txt b/requirements/main.txt index 59513665703c..7051fe68617f 100644 --- a/requirements/main.txt +++ b/requirements/main.txt @@ -1717,9 +1717,9 @@ pygments==2.18.0 \ # via # readme-renderer # rich -pyjwt[crypto]==2.8.0 \ - --hash=sha256:57e28d156e3d5c10088e0c68abb90bfac3df82b40a71bd0daa20c65ccd5c23de \ - --hash=sha256:59127c392cc44c2da5bb3192169a91f429924e17aff6534d70fdc02ab3e04320 +pyjwt[crypto]==2.9.0 \ + --hash=sha256:3b02fb0f44517787776cf48f2ae25d8e14f300e6d7545a4315cee571a415e850 \ + --hash=sha256:7e1e5b56cc735432a7369cbfa0efe50fa113ebecdc04ae6922deba8b84582d0c # via # -r requirements/main.in # pyjwt From 1bff60afad2ed758605ed5b1d5e3e61d85e01f88 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Wed, 7 Aug 2024 15:43:04 -0400 Subject: [PATCH 2/2] test: update to allow jwk decoding As updated in https://github.com/jpadilla/pyjwt/pull/886 Signed-off-by: Mike Fiedler --- tests/unit/oidc/test_services.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/unit/oidc/test_services.py b/tests/unit/oidc/test_services.py index 37ec3bc0deea..b9646897bdb7 100644 --- a/tests/unit/oidc/test_services.py +++ b/tests/unit/oidc/test_services.py @@ -972,15 +972,14 @@ def test_decodes_token_jwk_roundtrip(self): assert decoded == {"foo": "bar"} - def test_decodes_token_typeerror_on_pyjwk(self): + def test_decodes_token_pyjwk(self): privkey_jwk = PyJWK.from_json(algorithms.RSAAlgorithm.to_jwk(self._privkey)) pubkey_jwk = PyJWK.from_json(algorithms.RSAAlgorithm.to_jwk(self._pubkey)) token = jwt.encode({"foo": "bar"}, privkey_jwk.key, algorithm="RS256") + decoded = jwt.decode(token, pubkey_jwk, algorithms=["RS256"]) - # Passing a `PyJWK` directly into `jwt.decode` does not work. - with pytest.raises(TypeError, match=r"Expecting a PEM-formatted key\."): - jwt.decode(token, pubkey_jwk, algorithms=["RS256"]) + assert decoded == {"foo": "bar"} def test_decode_strict_aud(self): token = jwt.encode(