From c1e877d254b5342386475b7d13e26d670e8dcedb Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 13 Sep 2025 09:17:16 +0200 Subject: [PATCH] github_app_access_token: fix compatibility import of jwt (#10810) Fix compatibility import of jwt. --- changelogs/fragments/10810-github_app_access_token-jwt.yml | 2 ++ plugins/lookup/github_app_access_token.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/10810-github_app_access_token-jwt.yml diff --git a/changelogs/fragments/10810-github_app_access_token-jwt.yml b/changelogs/fragments/10810-github_app_access_token-jwt.yml new file mode 100644 index 0000000000..804ab9fbaa --- /dev/null +++ b/changelogs/fragments/10810-github_app_access_token-jwt.yml @@ -0,0 +1,2 @@ +bugfixes: + - "github_app_access_token lookup plugin - fix compatibility imports for using jwt (https://github.com/ansible-collections/community.general/issues/10807, https://github.com/ansible-collections/community.general/pull/10810)." diff --git a/plugins/lookup/github_app_access_token.py b/plugins/lookup/github_app_access_token.py index e4ed433231..f165759970 100644 --- a/plugins/lookup/github_app_access_token.py +++ b/plugins/lookup/github_app_access_token.py @@ -77,7 +77,8 @@ except ImportError: HAS_PYTHON_JWT = False # vs pyjwt if HAS_JWT and hasattr(jwt, 'JWT'): HAS_PYTHON_JWT = True - from jwt import jwk_from_pem, jwt_instance + from jwt import jwk_from_pem, JWT + jwt_instance = JWT() try: from cryptography.hazmat.primitives import serialization