litellm/tests/unit/integrations/open_telemetry
tavren27 4a83cbc0d6
fix(scim): answer every /scim/v2 error with the RFC 7644 SCIM Error schema (#51322)
* fix(scim): answer every /scim/v2 error with the RFC 7644 SCIM Error schema

Okta reads the detail of an RFC 7644 SCIM Error when it rejects a provisioning call, and the /scim/v2 routes answered with the proxy's OpenAI error shape or FastAPI's detail object instead, so a rejected create showed nothing after "Errors reported by remote server"

A route class on the SCIM router now turns every HTTPException, ProxyException and request validation error, auth and premium dependency failures included, into a SCIM Error served as application/scim+json with the same HTTP status. Duplicate userName and duplicate group creates carry scimType uniqueness, and a failed user create logs the userName, status and reason

* fix(scim): keep placeholder admin errors in the proxy shape and never drop an error's reason

The /scim/v2/placeholders list and merge routes are LiteLLM admin tools, so they
go back to the proxy's error body. An error detail SCIM cannot read now answers
its own text instead of the bare status phrase. The integration tests that read
SCIM error bodies now expect the SCIM Error schema.

* fix(scim): answer every SCIM route error as a SCIM Error and keep the span's error type

Every 409 on a SCIM route now answers scimType uniqueness, so a duplicate email
that only differs in case gets it too. An unexpected error answers a SCIM Error
with the status phrase and is logged like the handlers' own errors. The OTel
server span reports the ProxyException or a public RequestValidationError the
route raised instead of ScimError

* fix(scim): keep unexpected 5xx text out of SCIM detail and trace an HTTPException as itself

* fix(scim): keep deliberate 5xx reasons and log every refused SCIM create with its userName

A 5xx answers the status phrase only when its text is the raw text of an error raised without a status. The roster sync retry hint, the auth database outage 503, and other deliberate reasons keep their text, and each failed roster write is named with the same rule. The refused-create warning moves to the SCIM route, so a create refused by the key check or the body schema logs its userName too

* fix(scim): answer the status phrase for a 5xx whose reason quotes an unexpected error

A team write that wraps a database error in its own 500 put the table name in the SCIM roster sync detail. A 5xx now answers the status phrase whenever its reason carries the text of an error raised without a status, and keeps a reason that does not quote one

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-17 19:10:33 +00:00
..
data test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
__init__.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
_helpers.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
conftest.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
test_otel_admin_endpoints.py fix(proxy): trace model list requests with the caller's traceparent (#49141) 2026-10-31 01:22:45 -07:00
test_otel_exception_handler.py fix(scim): answer every /scim/v2 error with the RFC 7644 SCIM Error schema (#51322) 2026-11-17 19:10:33 +00:00
test_otel_passthrough_endpoints.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
test_otel_unified_endpoints.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
test_passthrough_parent_span.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00