Repository navigation
docs: iocs_by_hash accepts sha1/md5 and documents AMBIGUOUS_HASH - #335
Conversation
…refusal The server now resolves a sha1/md5 to one artifact on both IOC routes and refuses one naming several artifacts with a machine-readable 400. The SDK needs no code change (RequestException already exposes errors); document the contract and pin the refusal with a dual-transport respx test.
|
Review: one issue needs action. Docs, gitflow (base 1. Test coverage: the main new behaviour has no test (AGENTS.md "e2e-first"). The PR's headline is that a sha1/md5 now resolves to one artifact on both
Minor (no action required): the refusal test runs both routes in one loop on one |
|
Base ( The deferred e2e follow-up has no entry in
Please add a matching entry: extend the live pair with an md5 and a sha1 query on both |
|
Clean against AGENTS.md and specs/: targets |
alanjds
left a comment
There was a problem hiding this comment.
The reviewer rightly asks for test_iocs_by_hash / test_async_iocs_by_hash to also query by md5/sha1. That needs the cassettes re-recorded against a full stack running https://github.com/polyswarm/artifact-index/pull/2021, which I could not bring up locally.
This is interesting. Are we having issues with e2e locally?
TL;DR
iocs_by_hashacceptssha256,sha1ormd5(the server now resolves a sha1/md5 to one artifact on both theiocandioc-betaroutes).RequestExceptionwithexc.request.errors == {'code': 'AMBIGUOUS_HASH', 'hash_type', 'sha256s': [≤10], 'truncated'}. No typed exception, same rule asFAVORITE_LIMIT.test/ioc_by_hash_respx_test.pypinning that refusal on both routes.RequestExceptionalready exposeserrors. The two docstrings that wrongly describedhash_valueas a field list are fixed.Tests
pytest test/: 433 passed locally.Requires
The server-side change in polyswarm/artifact-index#2021. Against an older server a sha1/md5 is a plain 400, as before.
Not in this PR: e2e coverage of the sha1/md5 happy path
The reviewer rightly asks for
test_iocs_by_hash/test_async_iocs_by_hashto also query by md5/sha1. That needs the cassettes re-recorded against a full stack running polyswarm/artifact-index#2021, which I could not bring up locally. The gap and the exact steps to close it are recorded inspecs/99-open-questions.md.