Skip to content

Commit

Permalink
Merge pull request #474 from emmanvg/472-issue
Browse files Browse the repository at this point in the history
fix ordering problem with Class definitions
  • Loading branch information
clenk authored Nov 20, 2020
2 parents a82dc5e + 119364c commit f9e9c50
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 69 deletions.
12 changes: 6 additions & 6 deletions stix2/test/v21/test_malware_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
"type": "malware-analysis",
"spec_version": "2.1",
"id": "malware-analysis--f8afc020-f92f-4906-a971-88ee5882eb46",
"created_by_ref": "identity--e0353ed3-991e-4f71-a332-114c2f10b84f",
"created": "2017-11-28T09:44:58.418Z",
"modified": "2017-12-31T21:27:49.754Z",
"created_by_ref": "identity--e0353ed3-991e-4f71-a332-114c2f10b84f",
"labels": [
"label1",
"label2"
],
"product": "Acme Malware Analyzer",
"version": "2.5",
"host_vm_ref": "software--1bda7336-fe67-469f-a8ca-ab6268b0449b",
Expand All @@ -40,7 +36,11 @@
"file--fc27e371-6c88-4c5c-868a-4dda0e60b167",
"url--6f7a74cd-8eb2-4b88-a4da-aa878e50ac2e"
],
"sample_ref": "email-addr--499a32d7-74c1-4276-ace9-725ac933e243"
"sample_ref": "email-addr--499a32d7-74c1-4276-ace9-725ac933e243",
"labels": [
"label1",
"label2"
]
}"""


Expand Down
4 changes: 2 additions & 2 deletions stix2/v20/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ class MarkingDefinition(_STIXBase20, _MarkingsMixin):
('id', IDProperty(_type, spec_version='2.0')),
('created_by_ref', ReferenceProperty(valid_types='identity', spec_version='2.0')),
('created', TimestampProperty(default=lambda: NOW)),
('definition_type', StringProperty(required=True)),
('definition', MarkingProperty(required=True)),
('external_references', ListProperty(ExternalReference)),
('object_marking_refs', ListProperty(ReferenceProperty(valid_types='marking-definition', spec_version='2.0'))),
('granular_markings', ListProperty(GranularMarking)),
('definition_type', StringProperty(required=True)),
('definition', MarkingProperty(required=True)),
])

def __init__(self, **kwargs):
Expand Down
8 changes: 4 additions & 4 deletions stix2/v21/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class LanguageContent(_STIXBase21):
('object_modified', TimestampProperty(precision='millisecond')),
# TODO: 'contents' https://docs.google.com/document/d/1ShNq4c3e1CkfANmD9O--mdZ5H0O_GLnjN28a_yrEaco/edit#heading=h.cfz5hcantmvx
('contents', DictionaryProperty(spec_version='2.1', required=True)),
('revoked', BooleanProperty()),
('revoked', BooleanProperty(default=lambda: False)),
('labels', ListProperty(StringProperty)),
('confidence', IntegerProperty()),
('external_references', ListProperty(ExternalReference)),
Expand Down Expand Up @@ -156,12 +156,12 @@ class MarkingDefinition(_STIXBase21, _MarkingsMixin):
('id', IDProperty(_type)),
('created_by_ref', ReferenceProperty(valid_types='identity', spec_version='2.1')),
('created', TimestampProperty(default=lambda: NOW, precision='millisecond', precision_constraint='min')),
('external_references', ListProperty(ExternalReference)),
('object_marking_refs', ListProperty(ReferenceProperty(valid_types='marking-definition', spec_version='2.1'))),
('granular_markings', ListProperty(GranularMarking)),
('definition_type', StringProperty(required=True)),
('name', StringProperty()),
('definition', MarkingProperty(required=True)),
('external_references', ListProperty(ExternalReference)),
('object_marking_refs', ListProperty(ReferenceProperty(valid_types='marking-definition', spec_version='2.1'))),
('granular_markings', ListProperty(GranularMarking)),
])

def __init__(self, **kwargs):
Expand Down
Loading

0 comments on commit f9e9c50

Please sign in to comment.