Open clenk opened 3 years ago
@zrush-mitre - is this something we need before we release python-stix2 3.0? (for 2.1)
No rush to get this out with major release. I'll plan on working on this next week and hopefully submitting a PR.
So a little update for this issue:
The 'limit' filter is not difficult to implement on TAXIICollectionSource, since there's only one or two functions that will actually go to call the TAXII server and they already have a paging functionality included, so replacing that with an argument for the 'limit' filter is pretty easy and immediately works well.
The problem comes from the 'next' filter: since 'next' only ever gets used after subsequent 'limit' responses, it doesn't really make sense for a user to explicitly give this value in the request, since paged requests will just return all of the objects collected with multiple requests to the server. However, a user may not actually want to receive all the returned objects with the 'limit' filter in the first place, and instead, the TAXIICollectionSource would need to either hold onto paged objects and only give them to the user when requested, or the functions would need to be refactored to not make all paged requests immediately.
I'm not sure what is the best way forward here, so this requires further investigation.
_parse_taxii_filters()
doesn't support the TAXII 2.1-specific filters oflimit
,next
, orspec_version
.See also: https://github.com/oasis-open/cti-taxii-client/issues/100.