Commit 3ff48b1
Olivier Gintrand
feat(sso): add SSO_ENTRA_TEAM_MAPPING env var for declarative team mapping
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 #3997
Signed-off-by: Olivier Gintrand <olivier.gintrand@forterro.com>1 parent a2aa82a commit 3ff48b1
2 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
388 | 389 | | |
389 | 390 | | |
390 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
418 | | - | |
419 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
420 | 423 | | |
421 | 424 | | |
422 | 425 | | |
| |||
0 commit comments