feat(sso): add SSO_ENTRA_TEAM_MAPPING env var for declarative team mapping#3999
Closed
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
Closed
feat(sso): add SSO_ENTRA_TEAM_MAPPING env var for declarative team mapping#3999ecthelion77 wants to merge 1 commit intoIBM:mainfrom
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
Conversation
…pping
Add a new SSO_ENTRA_TEAM_MAPPING setting (JSON dict) to configure
Entra ID group-to-team mapping declaratively via environment variable,
enabling GitOps workflows for Kubernetes/Helm deployments.
Previously, team_mapping for the Entra provider was hard-coded to {}
in get_predefined_sso_providers(), making it impossible to set via env.
The existing preservation logic only kept DB mappings when env was
empty — it could not merge env + DB mappings.
Changes:
- config.py: Add sso_entra_team_mapping field (Dict[str, Any],
default={})
- sso_bootstrap.py: Use settings.sso_entra_team_mapping instead of {}
for the Entra provider definition
- sso_bootstrap.py: Replace simple preservation with smart merge
(env base + DB override) — same strategy already used for
provider_metadata. Admin API changes survive restarts while env
provides the base mapping.
This brings Entra ID to parity with Okta, which already supports
SSO_OKTA_TEAM_MAPPING.
Fixes IBM#3997
Signed-off-by: Olivier Gintrand <olivier.gintrand@forterro.com>
1988c84 to
3ff48b1
Compare
Open
3 tasks
Contributor
Author
|
Closing in favor of #4149 which includes this change as part of the comprehensive team management feature (role hierarchy, OIDC group sync, admin UI team scoping, team ownership isolation). |
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.
✨ Feature / Enhancement PR
🔗 Epic / Issue
Closes #3997
🚀 Summary
Add
SSO_ENTRA_TEAM_MAPPINGenvironment variable to declaratively configure Entra ID group-to-team mapping, enabling GitOps workflows for Kubernetes/Helm deployments. This brings Entra ID to parity with Okta, which already hasSSO_OKTA_TEAM_MAPPING.💡 Implementation
config.py: Newsso_entra_team_mappingfield (Dict[str, Any], default{}). Pydantic handles JSON parsing from the env var automatically.sso_bootstrap.py:settings.sso_entra_team_mappinginstead of hardcoded{}provider_metadata): env provides the base mapping, DB values override — so Admin API changes survive pod restarts while the env-defined base mapping is always presentUsage example (Helm values):
🧪 Checks
make lintpasses —make testpasses —📓 Notes
sso_entra_team_mappingdefaults to{}and behavior is identical to before✅ Checklist