Repository navigation
Drop the redundant OAuth2 branch from get_user and collect_request_tokens - #72889
Merged
vatsrahul1001 merged 1 commit intoSep 11, 2026
Merged
Conversation
pierrejeambrun
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
rawwar and
shubhamraj-git
as code owners
September 10, 2026 14:25
vincbeck
approved these changes
Sep 10, 2026
pierrejeambrun
force-pushed
the
drop-oauth2-scheme-redundant
branch
from
September 10, 2026 14:35
d76a8c7 to
91099ef
Compare
1 task done
…kens `HTTPBearer` and `OAuth2PasswordBearer` both extract the same `Authorization: Bearer` header, so declaring both as dependencies produces the same string twice. `get_user` had a dead branch for the OAuth2 side (the bearer branch above it always matched first), and `collect_request_tokens` deduped the duplicate anyway. Keep `oauth2_scheme` declared as an unused parameter so the OpenAPI security spec is unchanged and ``/docs`` still renders the OAuth2 password login form. Only the runtime dead code goes.
pierrejeambrun
force-pushed
the
drop-oauth2-scheme-redundant
branch
from
September 11, 2026 09:37
91099ef to
3041653
Compare
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
vatsrahul1001
pushed a commit
that referenced
this pull request
Sep 11, 2026
…t_request_tokens (#72889) (#72943) `HTTPBearer` and `OAuth2PasswordBearer` both extract the same `Authorization: Bearer` header, so declaring both as dependencies produces the same string twice. `get_user` had a dead branch for the OAuth2 side (the bearer branch above it always matched first), and `collect_request_tokens` deduped the duplicate anyway. Keep `oauth2_scheme` declared as an unused parameter so the OpenAPI security spec is unchanged and ``/docs`` still renders the OAuth2 password login form. Only the runtime dead code goes. (cherry picked from commit 677b4ab) Co-authored-by: Pierre Jeambrun <[email protected]>
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.
Follow-up to #72649, and stacked on it.
HTTPBearerandOAuth2PasswordBearerboth extract the sameAuthorization: Bearer <token>header. Declaring both as FastAPI dependencies produces thesame token string twice on every request, so:
get_user()had a dead second branch: the OAuth2 branch never ran becausethe
HTTPBearerbranch above it always matched first for any valid bearerrequest.
collect_request_tokens()(introduced by Revoke every credential presented to the Core API logout endpoint #72649) deduped the duplicateanyway.
Drop the runtime branch in both.
oauth2_schemestays declared as an unusedparameter on
get_userandlogoutso the OpenAPI security spec isunchanged and
/docsstill renders the OAuth2 password login form — thisis purely a runtime dead-code cleanup, no user-facing surface changes.
Verified locally: regenerated OpenAPI spec is byte-identical to the one on
#72649's HEAD; 130 tests pass in
test_security.py+test_auth.py; ruffand mypy clean.
This PR is stacked on #72649 and should be merged after it.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.7) following the guidelines