Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding STIX2 Bundle to MemorySource #202

Closed
elegantmoose opened this issue Jul 2, 2018 · 2 comments
Closed

adding STIX2 Bundle to MemorySource #202

elegantmoose opened this issue Jul 2, 2018 · 2 comments
Assignees
Milestone

Comments

@elegantmoose
Copy link
Contributor

https://github.com/oasis-open/cti-python-stix2/blob/master/stix2/datastore/memory.py#L36

Cant remember what I (or we) initially thought about adding a STIX2 Bundle to MemorySource but after using API, I expected the MemorySource to read in the parsed JSON STIX2 bundle and have access to the objects. Instead it just had access to the bundle object for querying. Also - we grab the objects out of a bundle if it is a dict bundle, but not if it is a python-stix2 bundle - which seems incongruous.

@gtback
Copy link
Contributor

gtback commented Jul 2, 2018

Could probably combine those first two if clauses into just if isinstance(stix_data, collections.abc.Mapping): or if isinstance(stix_data, (_STIXBase, dict)):

docs for collections.abc.Mapping, which _STIXBase subclasses.

emmanvg added a commit that referenced this issue Jul 11, 2018
Also, fixed adding STIX2 Bundles to MemorySource. Enhancements to 'save_to_file'. Fix docstrings and encoding support when writing to file. closes #202
@gtback
Copy link
Contributor

gtback commented Jul 13, 2018

I'm putting this in the STIX 2.1 milestone for now. If we want to release it in the 1.0.x branch, we can cherry-pick the necessary part of @emmanvg's commit.

@gtback gtback added this to the STIX 2.1 milestone Jul 13, 2018
emmanvg added a commit that referenced this issue Jul 13, 2018
@emmanvg emmanvg modified the milestones: 2.0.0, 1.1.0 Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants