Skip to content

Commit a661699

Browse files
committed
Remove deprecated authentication test for invoke endpoint
This commit removes the `test_invoke_requires_auth_when_enabled` test case from the FastAPI app endpoints. The test was enforcing authentication for the `/invoke` endpoint when the auth key was configured, but it is no longer necessary. This cleanup helps streamline the test suite and improve maintainability. No functional changes were made to the application code.
1 parent a6e31a3 commit a661699

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

tests/integration/functional/deployers/serving/test_app_endpoints.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -326,30 +326,6 @@ def test_invoke_endpoint_execution_failure(
326326
assert response.status_code == 200
327327
assert response.json()["success"] is False
328328

329-
def test_invoke_requires_auth_when_enabled(
330-
self,
331-
client_service_pair: Tuple[
332-
TestClient, StubPipelineServingService, ModuleType
333-
],
334-
monkeypatch: pytest.MonkeyPatch,
335-
) -> None:
336-
"""Enforce authentication when the auth key is configured."""
337-
client, _, _ = client_service_pair
338-
monkeypatch.setenv("ZENML_DEPLOYMENT_AUTH_KEY", "secret")
339-
340-
response = client.post(
341-
"/invoke", json={"parameters": {"city": "Paris"}}
342-
)
343-
assert response.status_code == 401
344-
345-
response = client.post(
346-
"/invoke",
347-
json={"parameters": {"city": "Paris"}},
348-
headers={"Authorization": "Bearer secret"},
349-
)
350-
assert response.status_code == 200
351-
monkeypatch.delenv("ZENML_DEPLOYMENT_AUTH_KEY")
352-
353329
def test_cleanup_called_on_shutdown(
354330
self,
355331
monkeypatch: pytest.MonkeyPatch,

0 commit comments

Comments
 (0)