litellm/tests/unit/proxy/management_endpoints/scim
mika-lt cad4570bbe
fix(scim): skip groups with no team so a PATCH or PUT still deactivates the user (#51829)
* fix(scim): skip groups with no team so a PATCH or PUT still deactivates the user

A group the IdP pushes before LiteLLM has a team for it made the roster
write fail, which answered 404 before the user row was written, so the
user stayed active and their keys kept serving. #37700 made that failure
fatal.

Groups with no team row are now logged and left out of the roster write,
the persisted teams, and the role resolution. Group ops after a replace
now apply in order, as RFC 7644 section 3.5.2 says.

* fix(scim): drop the redundant unchanged-groups return and cover the warning and PATCH admin role

* fix(scim): strip line breaks from the teamless-group warning

* fix(scim): read the PUT role from every requested group, as POST does

A PUT naming only a group with no team no longer demotes an admin whose admin group has no team. The new tests also get typed fixtures and Final locals

* fix(scim): look up the requested teams on the primary database, as the roster write does

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-14 12:06:52 -05:00
..
__init__.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_scim_key_deactivation.py fix(scim): write a group's roster in one locked transaction instead of one member at a time (#45197) 2026-10-15 10:57:00 -07:00
test_scim_patch_user.py fix(scim): skip groups with no team so a PATCH or PUT still deactivates the user (#51829) 2026-11-14 12:06:52 -05:00
test_scim_transformations.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_scim_v2_discovery.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_scim_v2_endpoints.py fix(scim): skip groups with no team so a PATCH or PUT still deactivates the user (#51829) 2026-11-14 12:06:52 -05:00