From 626d4b191792851b802908ad446fefdb68d83f08 Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Tue, 4 Aug 2026 00:09:03 +0200 Subject: [PATCH] fix(test): pin a dummy Gemini key so the webhook SSRF test runs the SSRF branch in CI --- tests/test_mcp_endpoint.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_mcp_endpoint.py b/tests/test_mcp_endpoint.py index 53f93f1..46b718a 100644 --- a/tests/test_mcp_endpoint.py +++ b/tests/test_mcp_endpoint.py @@ -129,7 +129,12 @@ class TestWebhookSigning: expected = "sha256=" + hmac.new(b"s3cret", body, hashlib.sha256).hexdigest() assert app_module._sign_webhook(body, "s3cret") == expected - def test_process_rejects_private_webhook_targets(self): + def test_process_rejects_private_webhook_targets(self, monkeypatch): + # The endpoint resolves a Gemini key before validating the webhook; a + # dummy env key keeps the test on the SSRF branch both on dev machines + # (where .env provides one anyway) and in CI (where nothing does). + monkeypatch.setenv("GEMINI_API_KEY", "test-dummy-key") + async def _run(): transport = httpx.ASGITransport(app=app) async with httpx.AsyncClient(transport=transport, base_url="http://t") as client: