Skip to content

[v3-3-test] Revoke every credential presented to the Core API logout endpoint (#72649) - #72933

Merged
vatsrahul1001 merged 1 commit into
v3-3-testfrom
backport-3f0a5d6-v3-3-test
Sep 11, 2026
Merged

vatsrahul1001 merged 1 commit into
v3-3-testfrom
backport-3f0a5d6-v3-3-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

logout() read only the _token cookie. A client authenticating with an
Authorization: Bearer header -- the documented way to call the Core API --
therefore received a normal logout response while its token was never revoked,
and that token stayed valid until it expired. The default lifetime is 24 hours.

A copy of the token held by anyone else survived the holder's logout, so asking
to be logged out did not end the session it was presented for.

Logout uses collect_request_tokens() and revokes all of them, not just the
precedence-selected one. It walks the same order get_user() authenticates by, so
logout does not hard-code its own separate answer to what a request's credentials
are. Revoking only the winner would leave any other credential the caller
presented valid after they asked to be logged out, and which credential wins is a
question about authentication that should not decide what a logout terminates.

Revocation still happens before any redirect or cookie deletion, so an external
auth-manager logout URL cannot skip it.

The bearer tests fail against unpatched sources with 'assert False is True' --
the token is simply not revoked.
(cherry picked from commit 3f0a5d6)

Co-authored-by: Jarek Potiuk jarek@potiuk.com
Generated-by: Claude Code (Opus 5)
Claude-Session: https://claude.ai/code/session_01XS3bodTDYYGrPmorhtLsjP

…endpoint (#72649)

logout() read only the _token cookie. A client authenticating with an
Authorization: Bearer header -- the documented way to call the Core API --
therefore received a normal logout response while its token was never revoked,
and that token stayed valid until it expired. The default lifetime is 24 hours.

A copy of the token held by anyone else survived the holder's logout, so asking
to be logged out did not end the session it was presented for.

Logout uses collect_request_tokens() and revokes all of them, not just the
precedence-selected one. It walks the same order get_user() authenticates by, so
logout does not hard-code its own separate answer to what a request's credentials
are. Revoking only the winner would leave any other credential the caller
presented valid after they asked to be logged out, and which credential wins is a
question about authentication that should not decide what a logout terminates.

Revocation still happens before any redirect or cookie deletion, so an external
auth-manager logout URL cannot skip it.

The bearer tests fail against unpatched sources with 'assert False is True' --
the token is simply not revoked.
(cherry picked from commit 3f0a5d6)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Generated-by: Claude Code (Opus 5)
Claude-Session: https://claude.ai/code/session_01XS3bodTDYYGrPmorhtLsjP
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Sep 11, 2026
@vatsrahul1001
vatsrahul1001 marked this pull request as ready for review September 11, 2026 09:34
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.3.2 milestone Sep 11, 2026
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Sep 11, 2026
@vatsrahul1001
vatsrahul1001 merged commit 7a8c720 into v3-3-test Sep 11, 2026
167 of 205 checks passed
@vatsrahul1001
vatsrahul1001 deleted the backport-3f0a5d6-v3-3-test branch September 11, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants