mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-30 06:43:27 +00:00
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
This commit is contained in:
parent
b2f931d6e0
commit
91aeff9300
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue