litellm/tests/test_litellm/proxy/management_endpoints
rioiart 98a244450e
Fix sso users not added to entra synced team (#17331)
* test: add failing tests for SSO user not added to Entra-synced teams bug

Adds tests reproducing the bug where new SSO users with teams=None
(from NewUserResponse) are not added to Entra ID synced teams because
add_missing_team_member() returns early when teams is None.

Tests demonstrate:
- NewUserResponse with teams=None fails to add user to teams (bug)
- LiteLLM_UserTable with teams=[] correctly adds user to teams (control)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: treat None as empty list in add_missing_team_member for new SSO users

Fixed bug where new SSO users logging in via Microsoft SSO were not added
to their Entra-synced teams. The issue was an early return when
user_info.teams is None (default for NewUserResponse). Now treats None
as an empty list so new users are properly added to all their SSO teams.

Location: litellm/proxy/management_endpoints/ui_sso.py:438-440

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-01 19:53:30 -08:00
..
scim fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_access_group_management.py [Feat] Model Management API - Add API Endpoint for creating model access group (#16663) 2025-11-14 16:40:43 -08:00
test_budget_endpoints.py [Bug Fix] Create/Update team member api 500 errror (#10479) 2025-06-03 15:57:33 -07:00
test_cache_settings_endpoints.py [Feat] UI - Allow setting cache settings on UI (#16143) 2025-10-31 17:43:59 -07:00
test_callback_management_endpoints.py [Feat] AI Gateway Auth - Allow using JWTs for signing in with Proxy CLI (#16756) 2025-11-17 19:47:29 -08:00
test_common_daily_activity.py
test_cost_tracking_settings.py [Feat] UI - Allow setting Provider Discounts on UI (#15550) 2025-10-14 20:08:18 -07:00
test_customer_budget.py test(customer): add unit tests for customer budget update functionality 2025-07-30 17:01:18 +00:00
test_customer_endpoints.py [Fix] Management Endpoints - Fixes inconsistent error responses in customer management endpoints. Non-existent user errors now return proper 404 status codes with consistent error schema format across all endpoints. (#16450) 2025-11-10 17:16:53 -08:00
test_delete_callbacks_endpoint.py test_delete_callbacks_in_db 2025-11-08 14:05:44 -08:00
test_entraid_app_roles.py fix: app_roles missing from jwt payload (#16448) 2025-11-12 12:07:04 -08:00
test_internal_user_endpoints.py Allow partial matches for user id in user table (#16952) 2025-11-21 19:12:16 -08:00
test_key_management_endpoints.py Org level tpm/rpm limits + Team tpm/rpm validation when assigned to org (#15549) 2025-10-25 13:40:29 -07:00
test_mcp_management_endpoints.py feat: add backend support for OAuth2 auth_type registration via UI (#17006) 2025-11-23 21:52:18 -08:00
test_model_management_endpoints.py Fix: Make PATCH /model/{model_id}/update handle team_id consistently with POST /model/new (#15297) 2025-10-07 14:04:08 -07:00
test_organization_endpoints.py Add Daily Org Spend Table, read path, and write path 2025-11-12 18:22:26 -08:00
test_tag_management_endpoints.py test tag mgmt 2025-10-11 08:48:37 -07:00
test_team_endpoints.py Fix/new org team validate against org (#17333) 2025-12-01 19:51:42 -08:00
test_ui_sso.py Fix sso users not added to entra synced team (#17331) 2025-12-01 19:53:30 -08:00