The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix SCIM GET /Users error when user_email is UUID
Haji Akhundovda71c5fa1603
diff --git a/litellm/proxy/management_endpoints/scim/scim_transformations.py b/litellm/proxy/management_endpoints/scim/scim_transformations.pyindex 1bb59888405..a741ddd697a 100644--- a/litellm/proxy/management_endpoints/scim/scim_transformations.py+++ b/litellm/proxy/management_endpoints/scim/scim_transformations.py@@ -40,7 +40,9 @@ class ScimTransformations:user_updated_at = user.updated_at.isoformat() if user.updated_at else Noneemails = []- if user.user_email:+ # Only add email if it's a valid email address (contains @)+ # user_email can be a UUID when users are created without an email+ if user.user_email and "@" in user.user_email:emails.append(SCIMUserEmail(value=user.user_email, primary=True))return SCIMUser(@@ -126,7 +128,7 @@ class ScimTransformations:for member in team.members_with_roles or []:if isinstance(member, dict):member = Member(**member)-+scim_members.append(SCIMMember(value=ScimTransformations._get_scim_member_value(member),@@ -161,7 +163,7 @@ class ScimTransformations:elif hasattr(member, "user_id"):return member.user_id or ScimTransformations.DEFAULT_SCIM_MEMBER_VALUEreturn ScimTransformations.DEFAULT_SCIM_MEMBER_VALUE-+@staticmethoddef _get_scim_member_display(member: Member) -> str:"""diff --git a/litellm/proxy/management_endpoints/scim/scim_v2.py b/litellm/proxy/management_endpoints/scim/scim_v2.pyindex b8f6b4a4460..5bce2807487 100644--- a/litellm/proxy/management_endpoints/scim/scim_v2.py+++ b/litellm/proxy/management_endpoints/scim/scim_v2.py@@ -310,7 +310,7 @@ async def _create_user_if_not_exists(new_user_request = NewUserRequest(user_id=user_id,- user_email=user_id, # We don't have email from group membership+ user_email=None, # We don't have email from group membershipuser_alias=None,teams=[], # Teams will be added separatelymetadata={"created_via": created_via},