litellm/tests/test_litellm/proxy/hooks
Sameer Kankute 19ea96da12
fix(proxy): authorize batch files using upload target_model_names (LIT-3593) (#30009)
* fix(proxy): authorize batch files using upload target_model_names (LIT-3593)

After replace_model_in_jsonl, body.model is a stripped provider id. Reverse-mapping it via resolve_model_name_from_model_id is first-match on model_list and caused false 403s when multiple deployments share the same stripped name. Use target_model_names from the unified file id instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(proxy): restore resolve_model_name_from_model_id for JSONL fallback path (LIT-3593)

Restores the reverse-lookup for the JSONL body.model fallback path so that
legacy/pre-target_model_names managed files still map stripped provider IDs
back to proxy aliases before auth. Also cleans up redundant `or None`.

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

* Revert "fix(proxy): restore resolve_model_name_from_model_id for JSONL fallback path (LIT-3593)"

This reverts commit 30d2e96f77.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 2cd7e87485)
2026-06-10 16:33:00 -07:00
..
test_async_post_call_streaming_iterator_hook.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_batch_file_validation.py fix(proxy): authorize batch files using upload target_model_names (LIT-3593) (#30009) 2026-06-10 16:33:00 -07:00
test_dynamic_rate_limiter_v3.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_image_generation_guardrails.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_key_management_event_hooks.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_max_budget_limiter.py [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
test_max_budget_per_session_limiter.py Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
test_max_iterations_limiter.py Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
test_parallel_request_limiter_v3.py [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
test_post_call_failure_hook_integration.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_post_call_response_headers_hook.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_post_call_streaming_hook_integration.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_post_call_success_hook_integration.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_prompt_injection_detection.py fix: prompt injection not working (#16701) 2025-11-17 20:04:57 -08:00
test_proxy_hooks_init.py [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
test_proxy_track_cost_callback.py [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
test_rate_limiter_toctou.py [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
test_send_invite_email.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00