mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* Add opt-in required customer headers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * Enforce YAML-only customer headers with Rust-first forwarding Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * Reuse typed settings for managed inference checks Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(proxy): support required customer headers per team and key * fix(proxy): centralize customer header policy authorization * fix(auth): avoid repeated required-header scans * fix(proxy): preserve model validation order and customer route boundaries * test(proxy): consolidate customer header regressions * test(proxy): fix Rust admission fixture lint * refactor(auth): enforce required customer headers inside common_checks Move the required-header check next to the team require_trace_id gate in common_checks, which already receives general_settings, the team object and the key. Restore user_api_key_auth.py to its base flow, so the shared checks again run on the managed-agent request after the configured model is injected, and customer resolution keeps its base route scope. Keep the enforce_batch_limits_are_admin_only name and call sites, adding required_customer_headers to the existing admin-only metadata keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(auth): refuse customer auto-registration when a required header is missing A request missing a required customer header is rejected in common_checks, but customer lookup runs first and could auto-register the org or member it names. Add the missing header as a reason in the existing registration_refusal gate, so gated_registrars skip the write and refuse_unknown_customer returns the 403. The policy merge and route scope live in one helper, missing_required_customer_header, shared with the common_checks gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(auth): apply required customer headers to pass-through routes Scope the required-header gate and the registration refusal the way the team require_trace_id gate is scoped: inference routes or a pass-through route, where a pass-through route is a built-in provider wildcard or a request dispatched to a user-configured pass-through endpoint. Share that predicate with the trace-id gate. The refusal now takes the request, so it can detect a dispatched pass-through endpoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Tin <tin@berri.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .coverage_baseline | ||
| __init__.py | ||
| _coverage_check.py | ||
| _pin_check.py | ||
| conftest.py | ||
| test_background_health.py | ||
| test_exception_handlers.py | ||
| test_harness_smoke.py | ||
| test_lifecycle.py | ||
| test_openapi_customization.py | ||
| test_proxy_config.py | ||
| test_routes_anthropic_beta.py | ||
| test_routes_assistants.py | ||
| test_routes_audio.py | ||
| test_routes_chat_completions.py | ||
| test_routes_completions.py | ||
| test_routes_config.py | ||
| test_routes_embeddings.py | ||
| test_routes_invitation.py | ||
| test_routes_login_sso.py | ||
| test_routes_misc.py | ||
| test_routes_model_cost_map.py | ||
| test_routes_model_info.py | ||
| test_routes_model_metrics.py | ||
| test_routes_models.py | ||
| test_routes_moderations.py | ||
| test_routes_onboarding.py | ||
| test_routes_queue.py | ||
| test_routes_threads.py | ||
| test_routes_utils.py | ||
| test_spend_counters.py | ||
| test_spend_counters_ledger.py | ||
| test_streaming_helpers.py | ||
| test_team_model_name_translation.py | ||