-- Per-team OIDC group configuration, replacing the global -- TERDUT_OIDC_GROUP_MAPPINGS env var. -- -- Group -> team -> role used to be one global list an operator set for the -- whole install, matched against a team by name, and the sync would create -- the team if no team by that name existed yet. That put the decision of -- which group controls a team in the server's environment rather than the -- team's own hands, meant changing it needed an env var edit and a restart, -- and let a typo in a team name silently create a stray team. -- -- Each team now names, itself, which group grants membership and which -- grants ownership. Nullable: most teams need neither. No uniqueness -- constraint on either column — two teams may legitimately watch the same -- provider group (a broad team and a narrower one both keyed off overlapping -- groups is a choice for their owners to make, not one the schema should -- refuse). -- -- BREAKING CHANGE, deliberately not auto-migrated: TERDUT_OIDC_GROUP_MAPPINGS -- stops being read as of this version, and the sync no longer creates a team -- by name. Every team's group binding must be set again through -- PUT /api/teams/{teamID}/oidc-groups. Until an owner does that, an -- OIDC-sourced membership in that team is dropped at that user's next SSO -- sign-in, the same way any other loss of group access is handled. See the -- README's OIDC section. ALTER TABLE teams ADD COLUMN oidc_member_group TEXT; ALTER TABLE teams ADD COLUMN oidc_owner_group TEXT;