addessing requested changes

stix2.0
= 2017-10-31 13:48:31 -04:00
parent 082973f780
commit d8e4f1ab98
2 changed files with 4 additions and 9 deletions

View File

@ -110,7 +110,7 @@
"from taxii2client import Collection\n",
"\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",
"tc_source = TAXIICollectionSource(collection)\n",
"\n",

View File

@ -1,10 +1,5 @@
"""
Python STIX 2.x
Classes:
TAXIICollectionStore
TAXIICollectionSink
TAXIICollectionSource
Python STIX 2.x TaxiiCollectionStore
"""
from stix2.base import _STIXBase
@ -122,7 +117,7 @@ class TAXIICollectionSource(DataSource):
# as directly retrieveing a STIX object by ID
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):
stix_obj = parse(stix_obj[0])
@ -190,7 +185,7 @@ class TAXIICollectionSource(DataSource):
if not isinstance(query, list):
# 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)
query = list(query)
query = [query]
query = set(query)
# combine all query filters