mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
* fix(proxy): re-assert the authenticated identity on passthrough requests The passthrough merges the client's litellm_metadata into the request metadata and then re-asserts only user_api_key and the parent span. Every other identity field the spend and budget pipeline reads stays whatever the request body set, so a body carrying user_api_key_user_id, user_api_key_team_id, user_api_key_org_id or user_api_key_end_user_id charges that user, team, org or end user instead of the caller. Re-assert the whole sanitized identity after the merge, so the client's copy of any of those fields is overwritten by the authenticated key's own values. * test(passthrough): assert no authenticated identity field is client settable The existing regression names seven fields; the re-assertion covers every field get_sanitized_user_information_from_key returns, which is twenty today. Derive the set from the helper so a field added to StandardLoggingUserAPIKeyMetadata is covered without touching the test. Two of the twenty were not covered before, including user_api_key_hash, which is distinct from user_api_key and was client settable. |
||
|---|---|---|
| .. | ||
| messages_api_structured_output | ||
| base_anthropic_messages_prompt_caching_test.py | ||
| base_anthropic_messages_tool_search_test.py | ||
| base_anthropic_unified_messages_test.py | ||
| conftest.py | ||
| test_anthropic_messages_passthrough.py | ||
| test_anthropic_messages_prompt_caching.py | ||
| test_anthropic_messages_tool_search.py | ||
| test_assemblyai_unit_tests_passthrough.py | ||
| test_bedrock_anthropic_messages_test.py | ||
| test_bedrock_tool_use_beta_header.py | ||
| test_claude_code_marketplace.py | ||
| test_context_management_polyfill.py | ||
| test_custom_logger_passthrough.py | ||
| test_pass_through_unit_tests.py | ||
| test_passthrough_managed_ids.py | ||
| test_passthrough_registry_updates.py | ||
| test_unit_test_anthropic_pass_through.py | ||
| test_unit_test_passthrough_router.py | ||
| test_unit_test_streaming.py | ||
| test_vertex_ai_anthropic_streaming_cost_injection.py | ||
| test_vertex_ai_live_passthrough.py | ||
| test_websearch_interception_e2e.py | ||