Fix the memory store to support the new top-level 2.1 SCOs. #342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #340 .
Checking whether an object is unversioned had been done via a marking check. But the marking check was really just a proxy to determining what we really wanted to know: whether the object was versioned. In hindsight, maybe that wasn't the best way to have done it, because it means that the new 2.1 SCOs are treated as versioned. (Although SCOs weren't TLOs at the time that code was written, so it wasn't wrong to have done it that way.)
I changed the check so it is done in a better way: if an object has the
modified
property, it is versioned. This should treat all current object types correctly. That doesn't work when you only have an ID, which is the case when you need to look up an object by ID (applicable to read operations). So that is also changed to simply react to the way the bookkeeping was set up for that ID when the object was added. If the ID was mapped to an_ObjectFamily
, it is versioned; otherwise not. So marking checks are entirely removed from the implementation now.Also added some unit tests for unversioned STIX objects.