clean up unsupported endpoints

This commit is contained in:
9qeklajc
2026-09-08 23:22:47 +02:00
parent 24bb4322bc
commit 419cc312e5
2 changed files with 18 additions and 11 deletions
-8
View File
@@ -234,14 +234,6 @@ _ALLOWED_ENDPOINTS: dict[str, frozenset[str]] = {
"responses": frozenset({"POST"}),
"messages": frozenset({"POST"}),
"embeddings": frozenset({"POST"}),
"moderations": frozenset({"POST"}),
"rerank": frozenset({"POST"}),
"audio/speech": frozenset({"POST"}),
"audio/transcriptions": frozenset({"POST"}),
"audio/translations": frozenset({"POST"}),
"images/generations": frozenset({"POST"}),
"images/edits": frozenset({"POST"}),
"images/variations": frozenset({"POST"}),
"models": frozenset({"GET"}),
"attestation": frozenset({"GET"}),
"tee/attestation": frozenset({"GET"}),
+18 -3
View File
@@ -69,6 +69,24 @@ def test_unknown_paths_are_not_forwarded() -> None:
assert _forwarding_allowed("secret-endpoint", "POST") is False
@pytest.mark.parametrize(
"path",
[
"moderations",
"rerank",
"audio/speech",
"audio/transcriptions",
"audio/translations",
"images/generations",
"images/edits",
"images/variations",
],
)
def test_unbilled_endpoints_are_not_forwarded_by_default(path: str) -> None:
assert _forwarding_allowed(path, "POST") is False
assert _forwarding_allowed(f"v1/{path}", "POST") is False
@pytest.mark.parametrize(
"path",
[
@@ -121,9 +139,6 @@ def test_known_prefix_does_not_carry_an_unknown_endpoint(path: str) -> None:
("v1/responses", "POST"),
("v1/messages", "POST"),
("v1/embeddings", "POST"),
("moderations", "POST"),
("audio/transcriptions", "POST"),
("images/generations", "POST"),
("models", "GET"),
("attestation", "GET"),
("tee/attestation", "GET"),