Skip to content

Keycloak CLI: provision multi‑team resources for auth manager (AIP‑67)#61256

Merged
vincbeck merged 8 commits intoapache:mainfrom
stegololz:feature/keycloak-auth-multiteam
Feb 19, 2026
Merged

Keycloak CLI: provision multi‑team resources for auth manager (AIP‑67)#61256
vincbeck merged 8 commits intoapache:mainfrom
stegololz:feature/keycloak-auth-multiteam

Conversation

@stegololz
Copy link
Contributor

@stegololz stegololz commented Jan 30, 2026

Description

This PR extends the Keycloak CLI to support multi‑team resources creation as outlined in AIP‑67. In multi‑team mode, team context from request details (e.g., team_name on DAGs, connections, assets) is now used to authorize access via team‑scoped Keycloak permissions. The model is:

  • Team = Keycloak group, role = role within that team.

  • Permissions are team‑scoped (e.g., Dag:team-a#LIST), so users only see and access resources for teams they belong to.

  • A global admin role remains available for cross‑team administration to preserve operational workflows and backward compatibility.

This CLI is updated to provision the required Keycloak objects for team mode, while remaining compatible with non‑multi‑team deployments (when --teams is not used, no team‑specific resources are created).

related: #60885


Was generative AI tooling used to co-author this PR?
  • Yes (Codex)

Generated-by: Codex following the guidelines

Copy link
Contributor

@vincbeck vincbeck left a comment

Choose a reason for hiding this comment

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

Thanks for working on this one. It is pretty massive. Could you split this PR in 2? One for the CLI, one for the rest? That will make the review easier.

@stegololz stegololz force-pushed the feature/keycloak-auth-multiteam branch from 6f33e07 to b093770 Compare February 2, 2026 14:13
@stegololz stegololz changed the title Multi-team authorization support for the Keycloak auth manager (AIP‑67) Multi-team CLI support for the Keycloak auth manager (AIP‑67) Feb 2, 2026
@stegololz stegololz changed the title Multi-team CLI support for the Keycloak auth manager (AIP‑67) Keycloak CLI: provision multi‑team resources for auth manager (AIP‑67) Feb 2, 2026
@vincbeck vincbeck requested a review from o-nikolas February 2, 2026 21:54
Copy link
Contributor

@o-nikolas o-nikolas left a comment

Choose a reason for hiding this comment

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

Plus one to @vincbeck comments regarding splitting this one up.

@stegololz stegololz force-pushed the feature/keycloak-auth-multiteam branch from 2bdf90b to 581e4eb Compare February 4, 2026 15:38
@bugraoz93
Copy link
Contributor

Thanks @stegololz for PR! Now it make a lot of sense to split, I overlooked single commit there :)

@stegololz stegololz force-pushed the feature/keycloak-auth-multiteam branch from c6eb21e to 98729f9 Compare February 6, 2026 10:32
@stegololz stegololz force-pushed the feature/keycloak-auth-multiteam branch 2 times, most recently from d34c3b9 to bb008c6 Compare February 17, 2026 13:19
Copy link
Contributor

@vincbeck vincbeck left a comment

Choose a reason for hiding this comment

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

Overall LGTM. I have to admit it is kind of hard to review all that code but I could not find anything off

@vincbeck
Copy link
Contributor

@bugraoz93 If you could take a look as well please

@vincbeck vincbeck marked this pull request as ready for review February 18, 2026 16:44
@vincbeck vincbeck requested a review from bugraoz93 as a code owner February 18, 2026 16:44
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks a lot, great work!
There is still one test failing on the PR, It would be amazing if you can solve it. We should be able to merge afterwards, otherwise this directly goes to CI teams plate :)

@stegololz stegololz force-pushed the feature/keycloak-auth-multiteam branch 2 times, most recently from dd2f7d0 to eb414e5 Compare February 19, 2026 13:40
@stegololz stegololz force-pushed the feature/keycloak-auth-multiteam branch from 39043de to 1ae6d6f Compare February 19, 2026 15:17
@stegololz
Copy link
Contributor Author

Thanks for the reviews!

Failing test have been fixed. I was not using the MenuItem Array, so resources were missing.

@vincbeck
Copy link
Contributor

Error unrelated to this PR, merging

@vincbeck vincbeck merged commit 61e5e89 into apache:main Feb 19, 2026
126 of 127 checks passed
choo121600 pushed a commit to choo121600/airflow that referenced this pull request Feb 22, 2026
apache#61256)

* feat: update keycloak CLI for multiteam setup

* feat: align team-scoped resources permissions with model and add global list permission in the cli

* docs: refine language in permissions documentation to be more assertive

* fix: update policy name format by removing redundant 'Team-' prefix

* feat: add global scoped resources and update permissions to include them

* reflect changes on auth_ manager on keycloak resource creation

* feat: add 'Jobs' to the CLI menu options in test_commands

* refactor: streamline resource names in permission creation by using MenuItem enumeration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants