From 91aeff930018ca8f84809e4c5ccf8389cf95f826 Mon Sep 17 00:00:00 2001 From: L4XB Date: Thu, 22 Oct 2026 14:14:14 +0200 Subject: [PATCH] test(proxy): run the keyless deepgram refusal on a proxy with a master key The test ran with no master key set, where the HTTP passthrough routes already accept a client without a key. A keyless WebSocket is now refused only when the proxy requires a key, so the test sets one --- .../test_deepgram_ws_passthrough_routes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/unit/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.py b/tests/unit/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.py index 404ed0f5800..a722d3b609c 100644 --- a/tests/unit/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.py +++ b/tests/unit/proxy/pass_through_endpoints/test_deepgram_ws_passthrough_routes.py @@ -303,7 +303,12 @@ def test_deepgram_listen_rejects_connections_without_a_litellm_key(): relay = _FakeRelay() client = TestClient(_app_with_relay(relay)) - with patch(GET_CREDENTIALS, return_value="dg-provider-key") as get_credentials: + with ( + patch(GET_CREDENTIALS, return_value="dg-provider-key") as get_credentials, + patch.multiple( # test-quality-ok: the real key auth path reads these proxy_server globals and has no injection seam + "litellm.proxy.proxy_server", master_key="sk-master", prisma_client=MagicMock() + ), + ): with pytest.raises(WebSocketDisconnect) as disconnect: with client.websocket_connect("/deepgram/v1/listen?model=nova-3"): pass