addessing requested changes
parent
082973f780
commit
d8e4f1ab98
|
@ -110,7 +110,7 @@
|
||||||
"from taxii2client import Collection\n",
|
"from taxii2client import Collection\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# establish TAXII2 Collection instance\n",
|
"# establish TAXII2 Collection instance\n",
|
||||||
"collection = Collection(\"http://127.0.0.1:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/\", user=\"admin\", password=\"password\")\n",
|
"collection = Collection(\"http://127.0.0.1:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/\", user=\"admin\", password=\"Password0\")\n",
|
||||||
"# supply the TAXII2 collection to TAXIICollection\n",
|
"# supply the TAXII2 collection to TAXIICollection\n",
|
||||||
"tc_source = TAXIICollectionSource(collection)\n",
|
"tc_source = TAXIICollectionSource(collection)\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Python STIX 2.x
|
Python STIX 2.x TaxiiCollectionStore
|
||||||
Classes:
|
|
||||||
TAXIICollectionStore
|
|
||||||
TAXIICollectionSink
|
|
||||||
TAXIICollectionSource
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from stix2.base import _STIXBase
|
from stix2.base import _STIXBase
|
||||||
|
@ -122,7 +117,7 @@ class TAXIICollectionSource(DataSource):
|
||||||
# as directly retrieveing a STIX object by ID
|
# as directly retrieveing a STIX object by ID
|
||||||
stix_objs = self.collection.get_object(stix_id)["objects"]
|
stix_objs = self.collection.get_object(stix_id)["objects"]
|
||||||
|
|
||||||
stix_obj = [apply_common_filters(stix_objs, query)]
|
stix_obj = list(apply_common_filters(stix_objs, query))
|
||||||
|
|
||||||
if len(stix_obj):
|
if len(stix_obj):
|
||||||
stix_obj = parse(stix_obj[0])
|
stix_obj = parse(stix_obj[0])
|
||||||
|
@ -190,7 +185,7 @@ class TAXIICollectionSource(DataSource):
|
||||||
if not isinstance(query, list):
|
if not isinstance(query, list):
|
||||||
# make sure dont make set from a Filter object,
|
# make sure dont make set from a Filter object,
|
||||||
# need to make a set from a list of Filter objects (even if just one Filter)
|
# need to make a set from a list of Filter objects (even if just one Filter)
|
||||||
query = list(query)
|
query = [query]
|
||||||
query = set(query)
|
query = set(query)
|
||||||
|
|
||||||
# combine all query filters
|
# combine all query filters
|
||||||
|
|
Loading…
Reference in New Issue