Comments (10)
I concur that the changes we've made in the API will necessitate some major changes at the client side. That being said, we can always change the API if it will help you. Are there server side changes we can make to ease this transition?
But otherwise, yes, I concur the with the changes described above.
from threatexchange.
Umm, like we chatted about I think being able to say "give me all fields" without having to specify each one specifically would be nice. It makes code not break and last longer when you can do something like fields=all
and no matter what changes you get all of the fields.
Other than that I haven't come up with much "it would be great if I could request...." things :) Give me some more time ;)
from threatexchange.
Yeah, the 'all fields' issue is sticky, since the fields functionality is built deep in the Facebook open graph stack. I was thinking about this today; as a short term solution, could pytx fetch some reference objects when it first starts up (i.e. a known malware, threat_indicator, etc) with the metadata=1 set and then use those return values to cache the set of available fields for each type?
from threatexchange.
Hmm. I'd like to shy away from making web requests to the graph that the user didn't specifically ask to do. It would be a bit more work on maintenance but we can check if someone sets "fields=all" in code and if they do replace "all" with the appropriate list of fields. It does make the code more version dependent (read: if you try to specify v2.3 and the code is for v2.4 things will break using fields=all).
from threatexchange.
Yeah, it's not ideal doing a fetch on some public reference object, but it might handle the version specific issues more cleanly. Though, I suppose we could also have a version indexed list of fields for the 'all' alias within the code.
from threatexchange.
With the latest PR up (#72) this will be complete with the exception of the "fields=all" thing. I think this can be closed and we can discuss that elsewhere :)
from threatexchange.
@mgoffin I've been making request like so to get all of the fields -
results = ThreatDescriptor.objects(type_='IP_ADDRESS', fields=ThreatDescriptor._fields,
text='127.0.0.1')
Haven't had any problems I notice. In the future I'll probably pare it down because I notice some of the fields are rarely used. I am trusting pytx
to maintain a correct field list.
from threatexchange.
That's a pretty clever way to go about that actually. The goal would be to make sure we handle all of the available fields in that list so I guess we can go with it as a solution :)
from threatexchange.
@mgoffin I just had the thought - could use @hammem suggestion ("pytx fetch some reference objects") in the test suite to make sure we have all of the fields for the appropriate endpoints in the module vocabulary.
from threatexchange.
Sounds doable. If you want, you can create another Issue to track the addition of field validation in the test suite.
from threatexchange.
Related Issues (20)
- Typing of SignalExchangeAPIWithSimpleUpdates is too Generic | remove use of t.Any
- [py-tx] CLI error opaque for PDQ match with low hash quality HOT 1
- [py-tx] Use the new NON_MALICIOUS reaction
- pdq_hasher error for B/W png HOT 1
- [py-tx] SignalType Reference implementation for Video TMK+PDQF Matching
- [py-tx] ThreatExchange checkpoint time implementation is incorrect, potentially skipping updates HOT 2
- [py-tx] Investigate dbm as a replacement for the default store
- /matches/for-hash/ returns 400, could not parse request HOT 9
- [hma] Clicking Sync button on the webui doesn't do anything
- [py-tx] New extension interface for storage
- [py-ty] Venv setup documentation and/or files
- [hma] Cleanup Settings > ThreatExchange Tab
- [hma] 500 error thrown on invalid PDQ hash HOT 1
- [HMA] graph API 9.0 hardcoded, now deprecated HOT 1
- [py-tx][HMA-in-a-bottle] Modularising py-tx -- Draft roadmap HOT 6
- [hma] Fetcher policy fails to access index HOT 1
- [hma] submitting content gets stuck between "hashed" and "matched" HOT 2
- /matches/for-hash/ gives AttributeError: 'IndexMatchUntyped' object has no attribute 'distance' HOT 1
- [pytx] No match results if creating a local_file with only 1 hash in it HOT 1
- [hma] Size of hashkey has exceeded the maximum size limit of 2048 bytes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from threatexchange.