litellm/tests/test_litellm/proxy
Cole McIntosh e191e72746
Fix: Respect user_header_name property for budget selection and user identification (#11419)
* Refactor get_end_user_id_from_request_body to support user ID retrieval from custom headers and multiple request body formats. Enhance tests to cover various scenarios including header precedence and fallback mechanisms.

* Refactor get_end_user_id_from_request_body function to accept request_body as the first parameter, improving clarity and flexibility. Update tests for compatibility and add new cases to ensure correct functionality across various request body formats.

* Update _user_api_key_auth_builder and user_api_key_auth to pass request object to get_end_user_id_from_request_body, enhancing user ID retrieval from request data.

* refactor(auth_utils.py): update get_end_user_id_from_request_body to accept request_headers instead of request, and adjust related function calls in user_api_key_auth and tests

* refactor(tests): update mock request handling in LLM pass-through endpoint tests

- Replaced the Request object with a Mock for better flexibility in testing.
- Enhanced mock setup to include user API key handling and virtual key retrieval.
- Updated test calls to reflect changes in mock request structure and added necessary patches for new dependencies.

* refactor(vertex_and_google_ai_studio_gemini.py): remove redundant variable declaration for url_context_metadata, linting error
2025-06-06 14:21:02 -07:00
..
anthropic_endpoints Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
auth [Feat] Enforce Vector Store Access Controls on LiteLLM Auth (#11281) 2025-05-30 22:20:11 -07:00
client Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
common_utils [Bug Fix] Create/Update team member api 500 errror (#10479) 2025-06-03 15:57:33 -07:00
db build(VLLM-Passthrough-with-loadbalancing-support-(enables-using-model-list-for-VLLM-/classify-endpoint)): Closes #11205 2025-05-31 09:00:04 -07:00
experimental/mcp_server Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
guardrails build(VLLM-Passthrough-with-loadbalancing-support-(enables-using-model-list-for-VLLM-/classify-endpoint)): Closes #11205 2025-05-31 09:00:04 -07:00
health_endpoints Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
hooks feat(parallel_request_limiter_v2.py): add sliding window logic (#11283) 2025-05-31 10:06:42 -07:00
image_endpoints Feat: add add azure endpoint for image endpoints (#11482) 2025-06-06 10:38:37 -07:00
management_endpoints UI / SSO - Update proxy admin id role in DB + Handle SSO redirects with custom root path (#11384) 2025-06-03 21:16:55 -07:00
middleware Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
openai_files_endpoint Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
pass_through_endpoints Fix: Respect user_header_name property for budget selection and user identification (#11419) 2025-06-06 14:21:02 -07:00
spend_tracking Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_configs Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
types_utils Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
ui_crud_endpoints Refactor settings response models in proxy_setting_endpoints.py 2025-06-04 15:08:05 -06:00
test_caching_routes.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_common_request_processing.py [Feat] DD Trace - Add instrumentation for streaming chunks (#11338) 2025-06-02 16:48:39 -07:00
test_custom_proxy.py Custom Root Path Improvements: don't require reserving /litellm route (#11460) 2025-06-05 16:36:47 -07:00
test_litellm_pre_call_utils.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_proxy_cli.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_proxy_server.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_proxy_utils.py UI / SSO - Update proxy admin id role in DB + Handle SSO redirects with custom root path (#11384) 2025-06-03 21:16:55 -07:00
test_route_llm_request.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_spend_log_cleanup.py [Feat] Make batch size for maximum retention in spend logs a controllable parameter (#11459) 2025-06-05 17:11:51 -07:00
test_team_member_update.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00