feat: 31 new tests, metrics LLM counters, Dockerfile caching, Makefile targets, compose limits, code fixes
This commit is contained in:
@@ -164,3 +164,42 @@ async def test_webhook_invalid_signature(client, sample_nexus_webhook):
|
||||
assert resp.status_code == 403
|
||||
|
||||
guarddog_nexus.config.config.webhook_secret = ""
|
||||
|
||||
|
||||
# --- Unknown ecosystem rejection ---
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_webhook_rejects_unknown_ecosystem_asset(client):
|
||||
resp = await client.post(
|
||||
"/webhooks/nexus",
|
||||
json={
|
||||
"action": "UPDATED",
|
||||
"repositoryName": "test-repo",
|
||||
"asset": {
|
||||
"format": "maven",
|
||||
"name": "/packages/test/1.0/test-1.0.tar.gz",
|
||||
"downloadUrl": "http://nexus:8081/repo/test/1.0/test-1.0.tar.gz",
|
||||
},
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
data = resp.json()
|
||||
assert data["status"] == "ignored"
|
||||
assert data["reason"] == "unknown_ecosystem"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_webhook_rejects_unknown_ecosystem_component(client):
|
||||
resp = await client.post(
|
||||
"/webhooks/nexus",
|
||||
json={
|
||||
"action": "UPDATED",
|
||||
"repositoryName": "test-repo",
|
||||
"component": {"format": "maven", "name": "test", "version": "1.0"},
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
data = resp.json()
|
||||
assert data["status"] == "ignored"
|
||||
assert data["reason"] == "unknown_ecosystem"
|
||||
|
||||
Reference in New Issue
Block a user