Skip to content

Raise a warning instead of an error if extra teams are defined in the auth manager#68935

Open
stephen-bracken wants to merge 1 commit into
apache:mainfrom
stephen-bracken:soft-fail-teams
Open

Raise a warning instead of an error if extra teams are defined in the auth manager#68935
stephen-bracken wants to merge 1 commit into
apache:mainfrom
stephen-bracken:soft-fail-teams

Conversation

@stephen-bracken

Copy link
Copy Markdown
Contributor

Don't raise an error on startup if the Auth Manager has additional teams

In the case of the KeycloakAuthManager, defining additional teams in the Auth Manager should not interact with the airflow system in a negative way, as the Auth Manager will only issue auth requests to keycloak based on access of resources. These must be mapped to teams that actually exist in the database, as they are created in Airflow.
Despite this, adding additional team resources to the keycloak client will cause the api server to crash on startup until the teams are added to the database as well. This makes the system more brittle by introducing an implicit order of actions which new teams must go through to be added. (i.e. 1. add to database, 2. add to auth manager 3. add to dags)

Raising a warning at startup instead tells admins that they need to update their configuration without affecting the normal running of the api server.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
  • No

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Jun 24, 2026
@stephen-bracken stephen-bracken force-pushed the soft-fail-teams branch 8 times, most recently from 3b3dbb0 to bc4a7bf Compare June 24, 2026 09:58
@stephen-bracken stephen-bracken marked this pull request as ready for review June 24, 2026 13:11

@SameerMesiah97 SameerMesiah97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One thing I noticed is that the new db_teams - am_teams warning is a new validation path rather than a straight severity downgrade of the existing check.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants