Request: Add hash data to /m/lookup or match data to /h/raw_lookup
In the current API design:
/h/hash returns raw hashes:
{
"pdq": "facd8bcb2a49bcebdec1985298d5fe84bcd006c187c598c720c3c087b3fdb318",
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"phash": "a1b2c3d4e5f6789a"
}
/m/raw_lookup returns only match distances:
/m/lookup returns match and bank info - but not the hash values themselves:
{
"EXAMPLE_BANK": {
"pdq": [
{
"bank_content_id": 123,
"distance": "0"
},
{
"bank_content_id": 456,
"distance": "5"
}
],
"md5": [
{
"bank_content_id": 789,
"distance": "0"
}
]
}
}
Problem
In our deployment, we’re following the HMA model where hasher, matcher, and curator run as separate services. This breaks compatibility with /h/lookup, which expects both hashing and matching on the same instance.
To persist both the hashes and the bank matches for reporting in our app, we’re forced to:
- Call
/h/hash to get the hashes.
- Call
/m/lookup to get the matches
- Enable hashing in our matcher to enable
/m/lookup, which defeats service separation.
Feature Request
We’d like to be able to fully decouple hasher and matcher services, and still retrieve both hashes and matches. I propose two possible solutions:
Summary
Right now, the only way to get both hashes and bank match data is via /m/lookup, which implicitly requires combining the hasher and matcher roles.
We’d appreciate a way to retrieve both hash and match info while preserving the ability to scale the hasher and matcher independently.
Request: Add hash data to
/m/lookupor match data to/h/raw_lookupIn the current API design:
/h/hashreturns raw hashes:{ "pdq": "facd8bcb2a49bcebdec1985298d5fe84bcd006c187c598c720c3c087b3fdb318", "md5": "d41d8cd98f00b204e9800998ecf8427e", "phash": "a1b2c3d4e5f6789a" }/m/raw_lookupreturns only match distances:{ "matches": [0] }/m/lookupreturns match and bank info - but not the hash values themselves:{ "EXAMPLE_BANK": { "pdq": [ { "bank_content_id": 123, "distance": "0" }, { "bank_content_id": 456, "distance": "5" } ], "md5": [ { "bank_content_id": 789, "distance": "0" } ] } }Problem
In our deployment, we’re following the HMA model where hasher, matcher, and curator run as separate services. This breaks compatibility with
/h/lookup, which expects both hashing and matching on the same instance.To persist both the hashes and the bank matches for reporting in our app, we’re forced to:
/h/hashto get the hashes./m/lookupto get the matches/m/lookup, which defeats service separation.Feature Request
We’d like to be able to fully decouple hasher and matcher services, and still retrieve both hashes and matches. I propose two possible solutions:
Option A: Extend
/m/lookupto include the generated hash values alongside the match data.Option B: Extend
/h/raw_lookupto include the same bank match info as/m/lookup.Summary
Right now, the only way to get both hashes and bank match data is via
/m/lookup, which implicitly requires combining the hasher and matcher roles.We’d appreciate a way to retrieve both hash and match info while preserving the ability to scale the hasher and matcher independently.