From 9a966f45c3ea285accf8d8f88f2c923ff5538a74 Mon Sep 17 00:00:00 2001 From: Christian Studer Date: Mon, 23 May 2022 11:46:54 +0200 Subject: [PATCH] chg: [interoperability] Removed changes on interoperability parameters - Since the code changed a lot, there is no longer need to deal with it in the classes defined in the files concerned here --- stix2/v20/bundle.py | 8 -------- stix2/v20/common.py | 6 ------ stix2/v20/sdo.py | 6 ------ stix2/v20/sro.py | 9 --------- stix2/v21/base.py | 3 --- stix2/v21/bundle.py | 8 -------- stix2/v21/common.py | 6 ------ stix2/v21/sdo.py | 5 ----- stix2/v21/sro.py | 9 --------- 9 files changed, 60 deletions(-) diff --git a/stix2/v20/bundle.py b/stix2/v20/bundle.py index 4fffbc9..42b6876 100644 --- a/stix2/v20/bundle.py +++ b/stix2/v20/bundle.py @@ -35,14 +35,6 @@ class Bundle(_STIXBase20): kwargs['objects'] = obj_list + kwargs.get('objects', []) - allow_custom = kwargs.get('allow_custom', False) - self._allow_custom = allow_custom - self._properties['objects'].contained.allow_custom = allow_custom - interoperability = kwargs.get('interoperability', False) - self.__interoperability = interoperability - self._properties['id'].interoperability = interoperability - self._properties['objects'].contained.interoperability = interoperability - super(Bundle, self).__init__(**kwargs) def get_obj(self, obj_uuid): diff --git a/stix2/v20/common.py b/stix2/v20/common.py index a0d9c28..feaa3ef 100644 --- a/stix2/v20/common.py +++ b/stix2/v20/common.py @@ -147,12 +147,6 @@ class MarkingDefinition(_STIXBase20, _MarkingsMixin): if not isinstance(kwargs['definition'], marking_type): defn = _get_dict(kwargs['definition']) kwargs['definition'] = marking_type(**defn) - interoperability = kwargs.get('interoperability', False) - self._properties['id'].interoperability = interoperability - if kwargs.get('created_by_ref'): - self._properties['created_by_ref'].interoperability = interoperability - if kwargs.get('object_marking_refs'): - self._properties['object_marking_refs'].contained.interoperability = interoperability super(MarkingDefinition, self).__init__(**kwargs) diff --git a/stix2/v20/sdo.py b/stix2/v20/sdo.py index 26247b1..57013b2 100644 --- a/stix2/v20/sdo.py +++ b/stix2/v20/sdo.py @@ -248,12 +248,6 @@ class Report(_DomainObject): ('granular_markings', ListProperty(GranularMarking)), ]) - def __init__(self, *args, **kwargs): - self._properties['object_refs'].contained.allow_custom = kwargs.get('allow_custom', False) - self._properties['object_refs'].contained.interoperability = kwargs.get('interoperability', False) - - super(Report, self).__init__(*args, **kwargs) - class ThreatActor(_DomainObject): """For more detailed information on this object's properties, see diff --git a/stix2/v20/sro.py b/stix2/v20/sro.py index 688f3d7..1372a5e 100644 --- a/stix2/v20/sro.py +++ b/stix2/v20/sro.py @@ -48,9 +48,6 @@ class Relationship(_RelationshipObject): kwargs['relationship_type'] = relationship_type if target_ref and not kwargs.get('target_ref'): kwargs['target_ref'] = target_ref - interoperability = kwargs.get('interoperability', False) - self._properties['source_ref'].interoperability = interoperability - self._properties['target_ref'].interoperability = interoperability super(Relationship, self).__init__(**kwargs) @@ -86,11 +83,5 @@ class Sighting(_RelationshipObject): # Allow sighting_of_ref as a positional arg. if sighting_of_ref and not kwargs.get('sighting_of_ref'): kwargs['sighting_of_ref'] = sighting_of_ref - interoperability = kwargs.get('interoperability', False) - self._properties['sighting_of_ref'].interoperability = interoperability - if kwargs.get('observed_data_refs'): - self._properties['observed_data_refs'].contained.interoperability = interoperability - if kwargs.get('where_sighted_refs'): - self._properties['where_sighted_refs'].contained.interoperability = interoperability super(Sighting, self).__init__(**kwargs) diff --git a/stix2/v21/base.py b/stix2/v21/base.py index 6fa3a3b..3878b79 100644 --- a/stix2/v21/base.py +++ b/stix2/v21/base.py @@ -12,9 +12,6 @@ class _STIXBase21(_STIXBase): class _Observable(_Observable, _STIXBase21): def __init__(self, **kwargs): - interoperability = kwargs.get('interoperability', False) - self.__interoperability = interoperability - self._properties['id'].interoperability = interoperability super(_Observable, self).__init__(**kwargs) if 'id' not in kwargs: # Specific to 2.1+ observables: generate a deterministic ID diff --git a/stix2/v21/bundle.py b/stix2/v21/bundle.py index 538f41d..270e4ef 100644 --- a/stix2/v21/bundle.py +++ b/stix2/v21/bundle.py @@ -32,14 +32,6 @@ class Bundle(_STIXBase21): kwargs['objects'] = obj_list + kwargs.get('objects', []) - allow_custom = kwargs.get('allow_custom', False) - self._allow_custom = allow_custom - self._properties['objects'].contained.allow_custom = allow_custom - interoperability = kwargs.get('interoperability', False) - self.__interoperability = interoperability - self._properties['id'].interoperability = interoperability - self._properties['objects'].contained.interoperability = interoperability - super(Bundle, self).__init__(**kwargs) def get_obj(self, obj_uuid): diff --git a/stix2/v21/common.py b/stix2/v21/common.py index 30c59df..55c4a05 100644 --- a/stix2/v21/common.py +++ b/stix2/v21/common.py @@ -222,12 +222,6 @@ class MarkingDefinition(_STIXBase21, _MarkingsMixin): if not isinstance(kwargs['definition'], marking_type): defn = _get_dict(kwargs['definition']) kwargs['definition'] = marking_type(**defn) - interoperability = kwargs.get('interoperability', False) - self._properties['id'].interoperability = interoperability - if kwargs.get('created_by_ref'): - self._properties['created_by_ref'].interoperability = interoperability - if kwargs.get('object_marking_refs'): - self._properties['object_marking_refs'].contained.interoperability = interoperability super(MarkingDefinition, self).__init__(**kwargs) diff --git a/stix2/v21/sdo.py b/stix2/v21/sdo.py index a06534b..209337e 100644 --- a/stix2/v21/sdo.py +++ b/stix2/v21/sdo.py @@ -698,11 +698,6 @@ class Report(_DomainObject): ('extensions', ExtensionsProperty(spec_version='2.1')), ]) - def __init__(self, *args, **kwargs): - self._properties['object_refs'].contained.interoperability = kwargs.get('interoperability', False) - - super(Report, self).__init__(*args, **kwargs) - class ThreatActor(_DomainObject): """For more detailed information on this object's properties, see diff --git a/stix2/v21/sro.py b/stix2/v21/sro.py index b056aee..bf636c3 100644 --- a/stix2/v21/sro.py +++ b/stix2/v21/sro.py @@ -55,9 +55,6 @@ class Relationship(_RelationshipObject): kwargs['relationship_type'] = relationship_type if target_ref and not kwargs.get('target_ref'): kwargs['target_ref'] = target_ref - interoperability = kwargs.get('interoperability', False) - self._properties['source_ref'].interoperability = interoperability - self._properties['target_ref'].interoperability = interoperability super(Relationship, self).__init__(**kwargs) @@ -108,12 +105,6 @@ class Sighting(_RelationshipObject): # Allow sighting_of_ref as a positional arg. if sighting_of_ref and not kwargs.get('sighting_of_ref'): kwargs['sighting_of_ref'] = sighting_of_ref - interoperability = kwargs.get('interoperability', False) - self._properties['sighting_of_ref'].interoperability = interoperability - if kwargs.get('observed_data_refs'): - self._properties['observed_data_refs'].contained.interoperability = interoperability - if kwargs.get('where_sighted_refs'): - self._properties['where_sighted_refs'].contained.interoperability = interoperability super(Sighting, self).__init__(**kwargs)