Skip to content

Commit 2e10988

Browse files
committed
Remove caching from STIX Entity classes
At least until mixbox caching has been reworked.
1 parent 1a69d21 commit 2e10988

11 files changed

Lines changed: 12 additions & 29 deletions

File tree

stix/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from mixbox import entities
1313
from mixbox import fields
1414
from mixbox import binding_utils
15-
from mixbox.cache import Cached
1615
from mixbox import namespaces
1716
from mixbox.vendor.six import StringIO, iteritems, itervalues, text_type, binary_type
1817

@@ -354,7 +353,7 @@ def _validate_version(instance, value):
354353
utils.check_version(instance._ALL_VERSIONS, value)
355354

356355

357-
class BaseCoreComponent(Cached, Entity):
356+
class BaseCoreComponent(Entity):
358357
_ALL_VERSIONS = ()
359358
_ID_PREFIX = None
360359

stix/coa/structured_coa.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# See LICENSE.txt for complete terms.
33

44
# external
5-
from mixbox.cache import Cached
65
from mixbox import entities
76
from mixbox import fields
87

@@ -18,7 +17,7 @@ def entity_class(cls, key):
1817
return stix.lookup_extension(key)
1918

2019

21-
class _BaseStructuredCOA(Cached, stix.Entity):
20+
class _BaseStructuredCOA(stix.Entity):
2221
_namespace = "http://stix.mitre.org/CourseOfAction-1"
2322
_binding = coa_binding
2423
_binding_class = coa_binding.StructuredCOAType

stix/common/identity.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# external
55
from mixbox import fields
66
from mixbox import entities
7-
from mixbox.cache import Cached
87

98
# internal
109
import stix
@@ -19,7 +18,7 @@ def entity_class(cls, key):
1918
return stix.lookup_extension(key, default=Identity)
2019

2120

22-
class Identity(Cached, stix.Entity):
21+
class Identity(stix.Entity):
2322
_binding = common_binding
2423
_namespace = 'http://stix.mitre.org/common-1'
2524
_binding_class = IdentityType

stix/core/stix_package.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# mixbox
55
from mixbox import idgen
66
from mixbox import fields
7-
from mixbox.cache import Cached
87

98
# cybox
109
from cybox.core import Observable, Observables
@@ -40,7 +39,7 @@
4039
import stix.bindings.stix_core as stix_core_binding
4140
import mixbox.entities
4241

43-
class STIXPackage(Cached, stix.Entity):
42+
class STIXPackage(stix.Entity):
4443
"""A STIX Package object.
4544
4645
Args:

stix/data_marking.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# external
55
from mixbox import fields
66
from mixbox import entities
7-
from mixbox.cache import Cached
87

98
# internal
109
import stix
@@ -23,7 +22,7 @@ def entity_class(cls, key):
2322
return stix.lookup_extension(key, default=MarkingStructure)
2423

2524

26-
class MarkingStructure(Cached, stix.Entity):
25+
class MarkingStructure(stix.Entity):
2726
_binding = stix_data_marking_binding
2827
_binding_class = stix_data_marking_binding.MarkingStructureType
2928
_namespace = 'http://data-marking.mitre.org/Marking-1'
@@ -55,7 +54,7 @@ def lookup_class(xsi_type):
5554
return stix.lookup_extension(xsi_type, default=MarkingStructure)
5655

5756

58-
class MarkingSpecification(Cached, stix.Entity):
57+
class MarkingSpecification(stix.Entity):
5958
_binding = stix_data_marking_binding
6059
_binding_class = stix_data_marking_binding.MarkingSpecificationType
6160
_namespace = 'http://data-marking.mitre.org/Marking-1'

stix/indicator/test_mechanism.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# external
55
from mixbox import fields, entities
6-
from mixbox.cache import Cached
76

87
# internal
98
import stix
@@ -13,7 +12,7 @@
1312
import stix.bindings.indicator as indicator_binding
1413

1514

16-
class _BaseTestMechanism(Cached, stix.Entity):
15+
class _BaseTestMechanism(stix.Entity):
1716
_namespace = "http://stix.mitre.org/Indicator-2"
1817
_binding = indicator_binding
1918
_binding_class = indicator_binding.TestMechanismType()

stix/report/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from mixbox import idgen
55
from mixbox import fields
6-
from mixbox.cache import Cached
76

87
from cybox.core import Observable, Observables
98

@@ -31,7 +30,7 @@
3130
import stix.bindings.report as report_binding
3231

3332

34-
class Report(Cached, stix.Entity):
33+
class Report(stix.Entity):
3534
"""A STIX Report Object.
3635
3736
Args:

stix/ttp/attack_pattern.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
22
# See LICENSE.txt for complete terms.
33

4-
# external
5-
from mixbox.cache import Cached
6-
74
# internal
85
import stix
96
from stix.common import StructuredTextList
@@ -13,7 +10,7 @@
1310

1411
from mixbox import fields, entities
1512

16-
class AttackPattern(Cached, stix.Entity):
13+
class AttackPattern(stix.Entity):
1714
_binding = ttp_binding
1815
_binding_class = _binding.AttackPatternType
1916
_namespace = "http://stix.mitre.org/TTP-1"

stix/ttp/exploit.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
22
# See LICENSE.txt for complete terms.
33

4-
# external
5-
from mixbox.cache import Cached
6-
74
# internal
85
import stix
96
from stix.common import StructuredTextList
@@ -13,7 +10,7 @@
1310

1411
from mixbox import fields
1512

16-
class Exploit(Cached, stix.Entity):
13+
class Exploit(stix.Entity):
1714
_binding = ttp_binding
1815
_binding_class = _binding.ExploitType
1916
_namespace = "http://stix.mitre.org/TTP-1"

stix/ttp/infrastructure.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# mixbox
55
from mixbox import fields
6-
from mixbox.cache import Cached
76

87
# cybox
98
from cybox.core import Observables
@@ -15,7 +14,7 @@
1514
import stix.bindings.ttp as ttp_binding
1615
from mixbox import fields, entities
1716

18-
class Infrastructure(Cached, stix.Entity):
17+
class Infrastructure(stix.Entity):
1918
_binding = ttp_binding
2019
_binding_class = _binding.InfrastructureType
2120
_namespace = "http://stix.mitre.org/TTP-1"

0 commit comments

Comments
 (0)