Repository navigation
feat(search): explain an ambiguous sha1/md5 on search ioc - #283
Conversation
The server now resolves a sha1/md5 on the forward IOC lookup and refuses one that names several artifacts with AMBIGUOUS_HASH. Render that refusal as a message listing the candidate sha256s (exit 2) instead of a raw 400; any other refusal is re-raised unchanged.
|
Review against AGENTS.md / specs
|
…equest Fall back to a message without the candidate list when the refusal carries no sha256s, pin the branch against a real PolyswarmRequest instead of a Mock, and record the second RequestException call site in specs/05.
|
No blocking issues. The
|
TL;DR
polyswarm search ioc sha1|md5 <hash>: when the server refuses a hash that matches several artifacts (AMBIGUOUS_HASH), print a message listing the candidate sha256s and how to re-run, at exit 2, instead of a raw 400.search iochelp andspecs/02-commands.mddescribe the behaviour.Tests
New
SearchIocByHashCliTest(sha1/md5 forwarded with their type; ambiguous md5 lists candidates at exit 2; other refusals not relabelled). Locallypytest tests: 241 passed; the 2 failures intests/api_uri_test.pyfail identically onorigin/developin my local environment.Requires
polyswarm/artifact-index#2021 for the server behaviour. No SDK change or version bump is needed: the error shape is read from the existing
RequestException(the SDK docs for it are in polyswarm/polyswarm-api#335, which this PR does not depend on).