Fixups after a rebase. There were several conflict resolutions

and I probably forgot some stuff...
pull/1/head
Michael Chisholm 2021-01-15 19:12:14 -05:00
parent bf284d0a0b
commit f8c86f7352
3 changed files with 9 additions and 9 deletions

View File

@ -71,7 +71,7 @@ def _detect_spec_version(stix_dict):
_detect_spec_version(obj) for obj in stix_dict["objects"]
),
)
elif obj_type in registry.STIX2_OBJ_MAPS["v21"]["observables"]:
elif obj_type in registry.STIX2_OBJ_MAPS["2.1"]["observables"]:
# Non-bundle object with an ID and without spec_version. Could be a
# 2.1 SCO or 2.0 SDO/SRO/marking. Check for 2.1 SCO...
v = "2.1"

View File

@ -86,7 +86,7 @@ def _register_observable(new_observable, version=DEFAULT_VERSION):
properties = new_observable._properties
if not version:
version = stix2.DEFAULT_VERSION
version = DEFAULT_VERSION
if version == "2.0":
# If using STIX2.0, check properties ending in "_ref/s" are ObjectReferenceProperties

View File

@ -8,7 +8,7 @@ import re
import pytz
import six
import stix2
import stix2.version
try:
import stix2.registry as mappings
except ImportError:
@ -340,7 +340,7 @@ def _stix_type_of(value):
return type_
def is_sdo(value, stix_version=stix2.DEFAULT_VERSION):
def is_sdo(value, stix_version=stix2.version.DEFAULT_VERSION):
"""
Determine whether the given object, type, or ID is/is for an SDO.
@ -360,7 +360,7 @@ def is_sdo(value, stix_version=stix2.DEFAULT_VERSION):
return result
def is_sco(value, stix_version=stix2.DEFAULT_VERSION):
def is_sco(value, stix_version=stix2.version.DEFAULT_VERSION):
"""
Determine whether the given object, type, or ID is/is for an SCO.
@ -377,7 +377,7 @@ def is_sco(value, stix_version=stix2.DEFAULT_VERSION):
return result
def is_sro(value, stix_version=stix2.DEFAULT_VERSION):
def is_sro(value, stix_version=stix2.version.DEFAULT_VERSION):
"""
Determine whether the given object, type, or ID is/is for an SRO.
@ -395,7 +395,7 @@ def is_sro(value, stix_version=stix2.DEFAULT_VERSION):
return result
def is_object(value, stix_version=stix2.DEFAULT_VERSION):
def is_object(value, stix_version=stix2.version.DEFAULT_VERSION):
"""
Determine whether an object, type, or ID is/is for any STIX object. This
includes all SDOs, SCOs, meta-objects, and bundle.
@ -413,7 +413,7 @@ def is_object(value, stix_version=stix2.DEFAULT_VERSION):
return result
def is_marking(value, stix_version=stix2.DEFAULT_VERSION):
def is_marking(value, stix_version=stix2.version.DEFAULT_VERSION):
"""Determines whether the given value is/is for a marking definition.
:param value: A STIX object, object ID, or type as a string.
@ -437,7 +437,7 @@ class STIXTypeClass(enum.Enum):
SRO = 2
def is_stix_type(value, stix_version=stix2.DEFAULT_VERSION, *types):
def is_stix_type(value, stix_version=stix2.version.DEFAULT_VERSION, *types):
"""
Determine whether the type of the given value satisfies the given
constraints. 'types' must contain STIX types as strings, and/or the