test(pass-through): fix langfuse auth=true test broken by allowed_passthrough_routes gate - #31420
Conversation
…=true test reaches rpm path #29256 made auth=true pass-through routes deny-by-default unless the key/team has allowed_passthrough_routes configured, but this integration test was not updated. The test key had no allowlist, so the auth=true parametrizations (rpm_limit=0 -> expect 429, rpm_limit=2 -> expect 207) now hit the 403 gate in auth before reaching the rpm/forwarding logic they mean to exercise. Grant the test key allowed_passthrough_routes for /api/public/ingestion so it clears the gate. Also removes a latent order-dependency: the case only passed locally when an earlier (auth=false) parametrization registered the route first; under worker isolation (CI xdist) it failed with 403.
Greptile SummaryThis PR fixes a broken integration test that started failing after PR #29256 made
Confidence Score: 5/5Single-file test fix with no production code changes; safe to merge. The only change is adding No files require special attention.
|
| Filename | Overview |
|---|---|
| tests/local_testing/test_pass_through_endpoints.py | Adds allowed_passthrough_routes to the mock key's metadata so the [True-0-429] RPM-limit test case passes the auth gate introduced by #29256 and reaches its intended code path. |
Reviews (1): Last reviewed commit: "test(pass-through): grant allowed_passth..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
This is a test-only change, so the proof is the test going from red to green. Run isolated so the latent order-dependency doesn't mask it (under CI xdist worker isolation the failing case runs alone):
Before (on
litellm_internal_staging):After (this branch):
The two
207cases ([True-2-207],[False-0-207]) forward to the live langfuse host; with the gate cleared they now reach forwarding and are served a207by the existing VCR cassette in CI. Locally without the cassette / credentials they surface a401from langfuse, which is unrelated to this change (the prior403came from the auth gate, before any forwarding)Type
✅ Test
Changes
tests/local_testing/test_pass_through_endpoints.py::test_aaapass_through_endpoint_pass_through_keys_langfuse[True-0-429]started failing in CI withassert 403 == 429. This is an outdated test, not a product regression. #29256 (fix(proxy): enforce allowed_passthrough_routes for auth=true pass-through) intentionally madeauth=truepass-through routes deny-by-default: a key/team must haveallowed_passthrough_routesconfigured or auth returns403. That PR updatedtests/test_litellm/proxy/auth/test_route_checks.pybut missed this integration testThe test key (
sk-my-test-key) has noallowed_passthrough_routes, so theauth=trueparametrizations now hit the403gate inuser_api_key_authbefore reaching the rpm / forwarding logic they are meant to exercise. It also exposed a latent order-dependency: in a single sequential process the earlierauth=falseparametrization registers the route first, so the gate did not re-fire and the test "passed"; under CI worker isolation it fails with403The fix grants the test key
allowed_passthrough_routes: ["/api/public/ingestion"]so it clears the gate and exercises the intended rpm / forwarding path