mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
test(mcp): assert platform-header probe test observes the 401 for an unknown caller
test_probe_receives_caller_platform_header_and_does_not_challenge had no assertion, which the test-quality gate counts as a new TQ001. Add a negative control showing a caller with a different platform header still gets the 401, so the test fails if the header stops reaching the probe. Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
This commit is contained in:
parent
906339f2ee
commit
c1ac75cbc7
1 changed files with 12 additions and 0 deletions
|
|
@ -7280,6 +7280,18 @@ class TestTruePassthroughProbeForwardsCallerHeaders:
|
|||
client_ip=None,
|
||||
raw_headers={"X-Platform-User": "alice"},
|
||||
)
|
||||
with pytest.raises(HTTPException) as exc_info:
|
||||
await server_module._raise_preemptive_401_for_unauthenticated_servers(
|
||||
scope=self._scope(),
|
||||
mcp_servers=[self.ALIAS],
|
||||
oauth2_headers=None,
|
||||
mcp_server_auth_headers=None,
|
||||
user_api_key_auth=UserAPIKeyAuth(),
|
||||
client_ip=None,
|
||||
raw_headers={"X-Platform-User": "bob"},
|
||||
)
|
||||
|
||||
assert exc_info.value.status_code == 401
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_probe_never_forwards_authorization_via_extra_headers(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue