Repository navigation
Authorize team-scoped plugin API endpoints in multi-team mode - #71919
Merged
o-nikolas merged 2 commits intoAug 25, 2026
Merged
Conversation
A plugin's team_name has so far only affected what the API returns about the plugin, not what its own endpoints allow. Because Airflow mounts plugin FastAPI apps on the shared API server and applies no authorization to them, a team-scoped plugin's endpoints were reachable by every authenticated user — so team_name. When multi-team mode is enabled, a team-scoped plugin's app is now mounted behind a middleware that rejects users who are not authorized for that team, using the auth manager's existing team check. Requests are authenticated the same way as the core API (bearer token or session cookie), and the request's HTTP method is mapped onto Airflow's resource methods so an auth manager can grant a team read-only access if it distinguishes them. Global plugins and deployments with multi-team disabled are unaffected. Root middlewares from a team-scoped plugin are skipped with a warning: they wrap every request to the API server, including other teams' and core routes, so they cannot be limited to one team. A team plugin that needs middleware should apply it inside its own app.
o-nikolas
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar,
shubhamraj-git and
vincbeck
as code owners
August 20, 2026 22:49
vincbeck
reviewed
Aug 21, 2026
Move to walrus operator but be sure to keep None check
vincbeck
approved these changes
Aug 25, 2026
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
…#71919) A plugin's team_name has so far only affected what the API returns about the plugin, not what its own endpoints allow. A team-scoped plugin's endpoints were reachable by every authenticated user. When multi-team mode is enabled, a team-scoped plugin's app is now mounted behind a middleware that rejects users who are not authorized for that team, using the auth manager's existing team check. Requests are authenticated the same way as the core API (bearer token or session cookie). Global plugins and deployments with multi-team disabled are unaffected. Root middlewares from a team-scoped plugin are skipped with a warning: they wrap every request to the API server, including other teams' and core routes, so they cannot be limited to one team. A team plugin that needs middleware should apply it inside its own app.
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.
A plugin's team_name has so far only affected what the API returns about the plugin, not what its own endpoints allow. Because Airflow mounts plugin FastAPI apps on the shared API server and applies no authorization to them, a team-scoped plugin's endpoints were reachable by every authenticated user — so team_name.
When multi-team mode is enabled, a team-scoped plugin's app is now mounted behind a middleware that rejects users who are not authorized for that team, using the auth manager's existing team check. Requests are authenticated the same way as the core API (bearer token or session cookie), and the request's HTTP method is mapped onto Airflow's resource methods so an auth manager can grant a team read-only access if it distinguishes them. Global plugins and deployments with multi-team disabled are unaffected.
Root middlewares from a team-scoped plugin are skipped with a warning: they wrap every request to the API server, including other teams' and core routes, so they cannot be limited to one team. A team plugin that needs middleware should apply it inside its own app.
UAT testing:
Before the changes. A user could not list plugins but could still call them:
Plugin
uat-team-adoes not show up in the list, but endpoints from that plugin can be calledWith this change they cannot list or call team plugins
Plugin

uat-team-adoes not show up in the list and the endpoints from that plugin cannot be calledWas generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.