mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Merge pull request #37679 from mubashir1osmani/litellm_lit5890_replay_key_params_form
test(e2e): pin query params and multipart form fields as replay match-key identity
This commit is contained in:
commit
d40aea865d
1 changed files with 10 additions and 0 deletions
|
|
@ -140,11 +140,21 @@ class TestKeyDistinctness:
|
|||
second = request(headers={"traceparent": "00-cc-dd-01", "x-api-key": "two"})
|
||||
assert canonicalize(first).key == canonicalize(second).key
|
||||
|
||||
def test_query_params_are_identity(self) -> None:
|
||||
first = request("get", "/v1/vector_stores", params={"limit": "100"})
|
||||
second = request("get", "/v1/vector_stores", params={"limit": "10"})
|
||||
assert canonicalize(first).key != canonicalize(second).key
|
||||
|
||||
def test_secret_set_versus_unset_stays_distinct(self) -> None:
|
||||
with_key = request(body={"api_key": "sk-live-aaaaaaaaaaaaaaaa"})
|
||||
without_key = request(body={"api_key": None})
|
||||
assert canonicalize(with_key).key != canonicalize(without_key).key
|
||||
|
||||
def test_form_fields_are_identity(self) -> None:
|
||||
first = request("upload", "/v1/files", form={"purpose": "assistants"}, file_sha256="a" * 64)
|
||||
second = request("upload", "/v1/files", form={"purpose": "batch"}, file_sha256="a" * 64)
|
||||
assert canonicalize(first).key != canonicalize(second).key
|
||||
|
||||
def test_file_content_is_identity(self) -> None:
|
||||
first = request(
|
||||
"upload", "/v1/files", file_name="batch.jsonl", file_sha256="a" * 64, file_bytes=10
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue