Initial selector and marking_ref validation.
parent
ee4618f6c8
commit
bf740b21eb
|
@ -11,6 +11,7 @@ from .exceptions import (AtLeastOnePropertyError, DependentPropertiesError,
|
||||||
MissingPropertiesError,
|
MissingPropertiesError,
|
||||||
MutuallyExclusivePropertiesError, RevokeError,
|
MutuallyExclusivePropertiesError, RevokeError,
|
||||||
UnmodifiablePropertyError)
|
UnmodifiablePropertyError)
|
||||||
|
from .markings.utils import validate
|
||||||
from .utils import NOW, format_datetime, get_timestamp, parse_into_datetime
|
from .utils import NOW, format_datetime, get_timestamp, parse_into_datetime
|
||||||
|
|
||||||
__all__ = ['STIXJSONEncoder', '_STIXBase']
|
__all__ = ['STIXJSONEncoder', '_STIXBase']
|
||||||
|
@ -80,8 +81,7 @@ class _STIXBase(collections.Mapping):
|
||||||
|
|
||||||
def _check_object_constraints(self):
|
def _check_object_constraints(self):
|
||||||
for m in self.get("granular_markings", []):
|
for m in self.get("granular_markings", []):
|
||||||
# TODO: check selectors
|
validate(self, m.get("selectors"), m.get("marking_ref"))
|
||||||
pass
|
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
cls = self.__class__
|
cls = self.__class__
|
||||||
|
|
Loading…
Reference in New Issue