[v3-2-test] Pin pyjwt>=2.11.0 in FAB provider and stabilise JWT tests under PyJWT 2.12 (#66840)#66885
Open
potiuk wants to merge 1 commit into
Open
[v3-2-test] Pin pyjwt>=2.11.0 in FAB provider and stabilise JWT tests under PyJWT 2.12 (#66840)#66885potiuk wants to merge 1 commit into
potiuk wants to merge 1 commit into
Conversation
… 2.12 (apache#66840) PyJWT 2.12.0 (2026-03-12) tightened type validation: jwt.encode now rejects iss=None with TypeError: Issuer (iss) must be a string. Two independent symptoms surfaced: 1. flask_jwt_extended.tokens.py does 'from jwt.types import Options', and jwt.types.Options was first added in PyJWT 2.11.0. The providers Compat 3.0.6 matrix job resolves pyjwt to 2.10.x because airflow-core 3.0.6's pyjwt floor is permissive, breaking collection of every providers/fab/tests/unit/fab/** test with: ImportError: cannot import name 'Options' from 'jwt.types' Pin pyjwt>=2.11.0 directly in providers/fab/pyproject.toml so the FAB provider keeps installing cleanly regardless of which airflow-core release it is paired with. This is the original fix. 2. Once pyjwt resolves to 2.12+, every test path that constructs a JWT without setting [api_auth] jwt_issuer fails with TypeError: Issuer (iss) must be a string. Current main is robust to this (commit a440d1d, 2026-01-31, deletes iss from the claims when the configured issuer is falsy), but airflow-core 3.0.6 (released 2025-08-25) predates that fix. Under the Compat 3.0.6 matrix this manifested as 41 test failures across edge3, keycloak, and FAB. This is a test-only issue — in production users either configure jwt_issuer themselves or the runtime error surfaces immediately; the unique hot path is tests that exercise JWT generation under default config. Fix by setting AIRFLOW__API_AUTH__JWT_ISSUER to a non-empty default in the shared test pytest_plugin, so every JWT-generating test path is invariant to which airflow-core version is installed. The four TestRevokeToken tests in test_tokens.py construct synthetic tokens without an iss claim on purpose and now pass issuer=None to the validator explicitly so they remain invariant to that default. Reproduced in: - https://github.com/apache/airflow/actions/runs/25760423290/job/75664049129 - https://github.com/apache/airflow/actions/runs/25777763902/job/75715167807 (cherry picked from commit 79a7a41)
vincbeck
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #66840 (merged 2026-05-13, commit `79a7a41`) to `v3-2-test`.
Clean `-x` cherry-pick — no conflicts. See the source PR for full motivation.
Test plan
🤖 Generated with Claude Code (Opus 4.7, 1M context)