Commit Graph

807 Commits (0ca2bc087a0a7440cf7f5e1666e07769809d3f9d)

Author SHA1 Message Date
Emmanuelle Vargas-Gonzalez 48e0442439 Fix tests in 'test_properties.py' 2018-07-10 16:10:01 -04:00
Emmanuelle Vargas-Gonzalez d24cddb547 Temporarily skip failing tests in workbench for v20, but the approach needs to be fixed 2018-07-10 16:08:36 -04:00
Emmanuelle Vargas-Gonzalez 4583da3ef2 Sort imports 2018-07-10 16:05:30 -04:00
Emmanuelle Vargas-Gonzalez ce42c02cee Fix tests that use property objects to call in the right path 2018-07-10 15:56:22 -04:00
Emmanuelle Vargas-Gonzalez 8cf68054d4 Remove str() as a way to serialize objects. Add support for encodings and Bundle versions. 2018-07-10 15:51:20 -04:00
Emmanuelle Vargas-Gonzalez 012eba4e9b Add new Bundle support for add_objects() request. Add encoding support.
Removed the version from all methods since it is no longer necessary.
2018-07-10 15:49:36 -04:00
Emmanuelle Vargas-Gonzalez 9b8cb09b1a Remove 'version' from calls to parse since it is no longer necessary
Also, fixed adding STIX2 Bundles to MemorySource. Enhancements to 'save_to_file'. Fix docstrings and encoding support when writing to file. closes #202
2018-07-10 15:43:58 -04:00
Emmanuelle Vargas-Gonzalez b6fefc52d9 Fix call to collect STIX2 mappings, make parse_observable available 2018-07-10 15:31:22 -04:00
Emmanuelle Vargas-Gonzalez 8d378fcf81 Remove STIXRelationshipObject from 'sro.py' 2018-07-10 15:27:05 -04:00
Emmanuelle Vargas-Gonzalez 023603d86f Remove duplicate code from 'sdo.py', removed STIXDomainObject
Apply proper 'spec_version' constraints to v21 objects
2018-07-10 15:22:21 -04:00
Emmanuelle Vargas-Gonzalez 54268ae7dd Remove observables and extension mappings, custom code and apply property constrain in v21 2018-07-10 15:20:16 -04:00
Emmanuelle Vargas-Gonzalez 1177694739 Adding docstrings to 2.1 objects 2018-07-10 15:15:33 -04:00
Emmanuelle Vargas-Gonzalez b722fdc0ed Remove duplicate register methods and CustomMarking code 2018-07-10 15:07:08 -04:00
Emmanuelle Vargas-Gonzalez 5332d54383 Refactor Bundle
Removed redundant STIXObjectProperty, for 2.1 use validation specific to that version
2018-07-10 15:02:55 -04:00
Emmanuelle Vargas-Gonzalez 78d77254ae Add object mappings in the top of each version package 2018-07-10 14:59:43 -04:00
Emmanuelle Vargas-Gonzalez 03e19f197c Moved STIXDomainObject and STIXRelationshipObject here, the observable
parsing code, minor changes to the mappings collections and all _register methods
2018-07-10 14:56:31 -04:00
Emmanuelle Vargas-Gonzalez b76888c682 Add a new 'custom.py' module to store and consolidate all custom code 2018-07-10 14:54:17 -04:00
Emmanuelle Vargas-Gonzalez f669656a4d Removed 'ExtensionsProperty' from workbench. 2018-07-10 14:52:10 -04:00
Emmanuelle Vargas-Gonzalez 7da6f1ed88 Add a package-wide 'properties.py'
Consolidated STIXObjectProperty, ExtensionsProperty, ObservableProperty code. Also added a 'spec_version' to allow validation changes per spec.
2018-07-10 14:50:03 -04:00
Emmanuelle Vargas-Gonzalez fe64fb044f Removed per version 'properties.py' 2018-07-10 14:47:30 -04:00
Emmanuelle Vargas-Gonzalez 645a258c62 Fix file indentation 2018-07-10 14:46:46 -04:00
Emmanuelle Vargas-Gonzalez edd7148e3c It appears we did not support the case when the Bundle contains 'utf-8' 2018-07-09 15:26:57 -04:00
Emmanuelle Vargas-Gonzalez 70a1e9522b Add 'stix2_data' test directory for v20 tests 2018-07-09 15:22:08 -04:00
Emmanuelle Vargas-Gonzalez 0197f9fd17 Minor fixes to tests. Some datastore had strange parameters in calls.
Fix error values for CustomMarking and fix incorrect test data
2018-07-09 15:20:04 -04:00
Emmanuelle Vargas-Gonzalez 646d941032 Removed 'test_memory' file and moved all tests into 'test_datastore_memory'
The tests under 'test_memory' were moved into a new file called 'test_datastore_composite' to make clear what we are testing.
2018-07-09 15:15:29 -04:00
Emmanuelle Vargas-Gonzalez 546216c396 Remove unnecessary 'True' in Memory datastore tests. 2018-07-09 15:07:05 -04:00
Emmanuelle Vargas-Gonzalez 8aeac369f4 Returning double quotes here... went overboard. 2018-07-09 14:59:19 -04:00
Emmanuelle Vargas-Gonzalez 21d5451d1c Small changes to tests 2018-07-06 14:11:59 -04:00
Emmanuelle Vargas-Gonzalez 52c1850655 Small addition to patterns.py 2018-07-06 14:08:49 -04:00
Greg Back 68aac583c9
Merge pull request #204 from oasis-open/refactor-properties
Refactor Properties
2018-07-05 17:16:25 -05:00
Greg Back 49c1931b4b
Merge pull request #203 from oasis-open/200-filter-contains
Add "contains" filter
2018-07-05 15:47:09 -05:00
Emmanuelle Vargas-Gonzalez 5be1636b10 Update v20 tests to ensure right methods and classes are used 2018-07-05 15:23:25 -04:00
Emmanuelle Vargas-Gonzalez 2c5ddc14af Update v21 tests for some missing methods, ensure we are calling and
using the right classes.
2018-07-05 15:21:09 -04:00
Greg Back 7c8113a4d9
Merge pull request #201 from oasis-open/188-uuidv4
Ensure all UUIDs are V4
2018-07-05 11:46:44 -05:00
Greg Back 12a22c0939 Remove unnecessary code related to defining properties. 2018-07-05 11:39:44 -05:00
Greg Back 25409b2099 GH-188: Update error message for invalid IDs. 2018-07-05 11:25:48 -05:00
Emmanuelle Vargas-Gonzalez bfa86bf87e Format objects in observed_data 2018-07-03 10:32:04 -04:00
Emmanuelle Vargas-Gonzalez 04680d8a3d First pass at making sure everything uses v21 classes and representations 2018-07-03 09:40:51 -04:00
Emmanuelle Vargas-Gonzalez 3100fa1fb8 Move v20 tests to their own package 2018-07-03 07:02:57 -04:00
Emmanuelle Vargas-Gonzalez da5b16dc2f Create v21 test package with new spec changes 2018-07-03 07:00:18 -04:00
Chris Lenk f47809eaaf Add "contains" filter
This allows filtering on, for example, observed-data objects that
contain a specific cyber observable.
2018-07-02 18:28:27 -04:00
Emmanuelle Vargas-Gonzalez c2f5a40986 Create new test subpackages 2018-06-30 19:36:54 -04:00
Emmanuelle Vargas-Gonzalez 2e6bb74be8 Add spec version 2.1 to object missing the property. 2018-06-29 18:48:41 -04:00
Emmanuelle Vargas-Gonzalez 7fd379d0b5 Minor style changes.
Removed OrderedDict and update()... Also a lot of single quoting except for errors
2018-06-29 18:38:04 -04:00
Greg Back a2e2407025 GH-188: Fixes for old Python syntax. 2018-06-27 12:49:00 -05:00
Greg Back d2f703b9d0 Reuse reference regex to match IDs as well.
Note that this means that UUIDs will no longer be converted, even when
there's an unambiguous mapping.
2018-06-27 12:27:44 -05:00
Greg Back e749218f9b GH-188: Test that references are always valid UUID v4. 2018-06-27 12:02:13 -05:00
Greg Back e5903f1832 Sort constants. 2018-06-27 11:36:17 -05:00
Greg Back 845625c174 GH-188: WIP: Converting all IDs to be valid UUID v4. 2018-06-27 11:35:55 -05:00
Emmanuelle Vargas-Gonzalez 59fdd3082e Update tests. 2018-06-26 12:29:20 -04:00
Emmanuelle Vargas-Gonzalez 9baaad6e08 Sort imports. 2018-06-26 12:23:53 -04:00
Emmanuelle Vargas-Gonzalez bee537137b
Update base.py
Fix STIXJSONIncludeOptionalDefaultsEncoder call to super()
2018-06-26 11:10:36 -04:00
Trey Darley 5cbe886cdb split properties out by spec version 2018-06-26 09:32:24 +00:00
Trey Darley d44c2abd0f 2.1 spec (somewhat inexplicably) limits dict keys to 250 chars 2018-06-26 09:23:52 +00:00
Trey Darley cc58a3a4f4 2.1 removes 3 char limit on dict keys 2018-06-26 09:22:57 +00:00
Trey Darley 6b1da856dd split properties out by spec version 2018-06-26 09:22:04 +00:00
Emmanuelle Vargas-Gonzalez b852b91652 Reformat methods documentation 2018-06-25 10:06:07 -04:00
Emmanuelle Vargas-Gonzalez 0ddb7b3807 Update observables.RasterImageExt 'image_weight' property to 'image_width' 2018-06-25 08:55:12 -04:00
Emmanuelle Vargas-Gonzalez abd172eb3f Merge branch 'master' of github.com:oasis-open/cti-python-stix2 into stix2.1 2018-06-25 08:25:57 -04:00
Greg Back b2c6acfbf6 GH-188: Restrict valid UUID values. 2018-06-22 14:40:30 -05:00
Greg Back fdf5937a71 GH-194: Remove unnecessary allow_custom kwarg. 2018-06-21 12:15:28 -05:00
Greg Back 7baeb153fa Correct "image_weight" to "image_width".
Fix #194.
2018-06-20 15:24:27 -05:00
Greg Back 53a1a0329a Merge branch 'master' into stix2.1 2018-06-15 10:04:00 -05:00
Michael Chisholm f09960d7ff Revamp code related to "pretty" JSON serialization, fix lurking
crash bugs.
2018-06-14 21:29:50 -04:00
Michael Chisholm 240a75861e Updated stix2.parse()-related docstrings. Its description of how
the "version" parameter was used, was out of date.
2018-06-14 15:56:02 -04:00
Michael Chisholm 486c588306 Fix silly isort check errors.. 2018-06-14 15:56:02 -04:00
Michael Chisholm 3101584b3d Fix test_bundle to compare against stix2.1 relationships. The
fixture those particular tests use creates 2.1 relationships.
2018-06-14 15:56:02 -04:00
Michael Chisholm 0c3f826c24 First cut at splitting the Bundle implementation into v20 and
v21 variants.  Also fixed up unit tests and got them passing
again.
2018-06-14 15:56:02 -04:00
Michael Chisholm ef8d45723f Update many unit tests to work with the malware2.1 API changes
I made.  The bundle tests and Bundle itself have not been fixed
yet in this commit.
2018-06-14 15:56:01 -04:00
Michael Chisholm f211649529 Made some minimal changes to support the STIX 2.1 Malware SDO,
and the maec2stix tool.
2018-06-14 15:56:01 -04:00
Greg Back 2e0dfc6592 Merge remote-tracking branch 'origin/master' into stix2.1 2018-06-14 12:42:06 -05:00
Greg Back 858a9752df
Merge pull request #185 from LiamSennitt/master
fix custom STIX objects with nested dictionary error #184
2018-06-12 14:40:55 -05:00
Emmanuelle Vargas-Gonzalez c12336b55a Revert changes to iterables. 2018-06-12 15:03:25 -04:00
Emmanuelle Vargas-Gonzalez 78a480aa08 Change str.isdecimal to isdigit. On lists keep iterating if unless index is found 2018-06-12 14:45:15 -04:00
Emmanuelle Vargas-Gonzalez fcffb165ad Add tests for `find_property_index` and `iterate_over_values` 2018-06-12 14:38:35 -04:00
Emmanuelle Vargas-Gonzalez 94d6610ca1 Merge branch 'master' of github.com:LiamSennitt/cti-python-stix2 2018-06-12 12:58:01 -04:00
Emmanuelle Vargas-Gonzalez 9be819ea6a Minor tweaks to return immediately after recursive call. Ensure dicts are matched alphabetically 2018-06-12 12:57:25 -04:00
Liam Sennitt bdec14937d fix flake8 errors in new test 2018-06-12 17:45:48 +01:00
Liam Sennitt 02894b5be6 add test for nested dictionary case 2018-06-12 17:32:46 +01:00
Greg Back 75e478312a Additional changes to match updates in v20 code. 2018-06-11 13:37:45 -05:00
Emmanuelle Vargas-Gonzalez 91cae0b5b7 Split `find_property_index` and support multiple levels of nesting. 2018-06-08 15:43:21 -04:00
Emmanuelle Vargas-Gonzalez 60da259805 Add an example on how to call the serialize() method. 2018-06-08 15:42:59 -04:00
Michael Chisholm 5a9f627669 Pickle-proof stix objects 2018-06-06 15:30:45 -04:00
Liam Sennitt dbe9c3f087 fix custom STIX objects with nested dictionary error #184 2018-06-01 13:49:32 +01:00
Greg Back 3e159abd4d WIP: Merge branch 'master' into stix2.1 2018-05-23 10:43:52 -05:00
Greg Back d67f2da0ea
Merge pull request #181 from oasis-open/http_error
Http error
2018-05-22 12:53:29 -05:00
= 3fb1840289 safer error class 2018-05-22 10:03:06 -04:00
Chris Lenk 636630a5aa Bump version: 1.0.1 → 1.0.2 2018-05-18 13:06:32 -04:00
= e484b7c25f formatting 2018-05-18 11:45:40 -04:00
= 6004ec597c solution to get 404 mocking problem 2018-05-18 11:19:05 -04:00
Chris Lenk ddc09f70c7 Set allow_custom if using a custom_properties dict
Fixes #179.
2018-05-17 09:04:44 -04:00
Chris Lenk cf972479ed Pass allow_custom to object dicts in a Bundle 2018-05-16 15:37:30 -04:00
= 8fc421e7d4 think the mock client was erroneous for get_object(), couldnt get object by id, just returned random object 2018-05-16 15:17:34 -04:00
= a3313bc08f creating native DataSourceError exception class to wrap taxii client and server errors 2018-05-16 13:23:50 -04:00
Chris Lenk 69c31ca3fc Pass allow_custom to ExtensionsProperty
Also fix bug caused by _properties being a class variable rather than an
instance variable. If you created an object with allow_custom,
allow_custom would be set for all future instances.
2018-05-16 12:14:33 -04:00
= 2b4c5bf264 handling and modifying exception messages in a manner acceptable by all python versions 2018-05-15 17:42:19 -04:00
= 0d3f80f2fe removing taxii 503 error test as not reproducible in Travis environment 2018-05-15 15:41:46 -04:00
= 2392912533 handle TAXII client/server errors according to decided policy 2018-05-15 11:28:34 -04:00
Chris Lenk 06e5a33639 Pass allow_custom when adding to ObservedData 2018-05-11 17:28:55 -04:00
Chris Lenk 102623b29a Bump version: 1.0.0 → 1.0.1 2018-04-27 16:51:47 -04:00
Chris Lenk 4229c380a2 Fix make_constant when value is already a constant
Fixes #171.
2018-04-26 10:20:46 -04:00
Emmanuelle Vargas-Gonzalez c15267971d Remove 'real_stix_objs1' as it is unused in the tests 2018-04-23 14:55:06 -04:00
Emmanuelle Vargas-Gonzalez 2043a514e1 Add two more tests for the `dict` case in TAXIICollectionSink 2018-04-23 14:47:32 -04:00
Emmanuelle Vargas-Gonzalez 7e5c8a9409 Sort import statements in tests. 2018-04-23 14:27:36 -04:00
Emmanuelle Vargas-Gonzalez 2fe9a0f297 Finish adding new tests for TAXII datastore. closes #148 2018-04-23 14:15:02 -04:00
Emmanuelle Vargas-Gonzalez e4a226cae6 Finish merging all the changes from @mbastian1135 2018-04-23 14:14:16 -04:00
Emmanuelle Vargas-Gonzalez 488012d39d Add support for 'real_stix_objs' for test cases 2018-04-23 14:12:54 -04:00
Emmanuelle Vargas-Gonzalez fb79e703b8 Simplify FilterSet instance in MemorySource 2018-04-23 14:12:16 -04:00
Emmanuelle Vargas-Gonzalez 8a9acfe487 Create TAXII query correctly. closes #169 2018-04-23 14:11:08 -04:00
Emmanuelle Vargas-Gonzalez 99a8f9e871 Merge branch 'master' into issue-148
# Conflicts:
#	stix2/test/test_datastore.py
#	tox.ini
2018-04-23 11:04:28 -04:00
Emmanuelle Vargas-Gonzalez 988dad79b9 WIP: Mock TAXIIClient Collection Endpoint 2018-04-23 09:11:59 -04:00
Emmanuelle Vargas-Gonzalez 84c09d7a8f Rename stix object fixture 2018-04-23 09:08:29 -04:00
Chris Lenk 161e10ec40 Bump version: 0.5.1 → 1.0.0 2018-04-16 14:57:35 -04:00
Chris Lenk 14dce03616 Provide default for revoked, sighting:summary.
This allows filter on un-revoked objects. Changes default JSONEncoder to
drop optional properties with default values in the spec if set to the
default value. They can be included by passing
include_optional_defaults=True to serialize().
2018-04-16 14:37:07 -04:00
Chris Lenk 194672ee2b Tweak FilterSet docstrings style 2018-04-13 17:11:07 -04:00
Chris Lenk 14d3543906
Merge branch 'master' into invalid-type-names 2018-04-13 16:38:17 -04:00
Chris Lenk f127d145c4
Merge pull request #166 from oasis-open/139-dict-filter-value
139 dict filter value
2018-04-13 16:35:32 -04:00
= 6df23e7268 removed unecessary checks, (clearly I need to review python ref model) 2018-04-13 16:06:31 -04:00
Chris Lenk a475fc6dbd Disallow invalid type names in custom classes 2018-04-13 14:52:00 -04:00
Chris Lenk a8b8bfe88b
Merge pull request #165 from oasis-open/161-dictionaryproperty-fixes
Allow dictionaries in a ListProperty
2018-04-13 14:39:04 -04:00
= a614a78e22 rm testing lines 2018-04-13 14:21:44 -04:00
= eba1844535 tweak to filter property checking to make sure original object property is not altered; added tests for this as well 2018-04-13 14:01:33 -04:00
Chris Lenk 58be98104f
Merge pull request #164 from oasis-open/157-allow-generic-custom-observables
Allow generic custom observables and custom observable extensions
2018-04-13 12:38:02 -04:00
= abe252e248 Merge branch 'master' of https://github.com/oasis-open/cti-python-stix2 into 139-dict-filter-value 2018-04-13 12:35:47 -04:00
= 61e091baf3 added FilterSet class for internal use; modified certain parsing processes to make deepcopies or suppled values(dicts) so as to taint original user passed data; added Filter logic to handle datetime objects; added/adjusted tests accordingly 2018-04-13 12:25:12 -04:00
Chris Lenk fc6a33b23e Disallow missing 'type' property with allow_custom
There was a bug where if you allowed custom content the library would parse an
object without the required 'type' property.
2018-04-13 11:18:56 -04:00
= 1a1e5e1616 WIP- getting close though 2018-04-13 11:08:03 -04:00
Emmanuelle Vargas-Gonzalez a8b7be88d0 Add support for pretty print case list of dictionaries. 2018-04-13 11:04:07 -04:00
Chris Lenk d08be151f7 Allow a ListProperty of DictionaryProperties 2018-04-12 21:26:48 -04:00
Chris Lenk 91376586d4 Simplify allowing custom observables/extensions 2018-04-12 16:33:08 -04:00
Chris Lenk 9ef5b395a8 Fix allowing custom observables and extensions 2018-04-12 14:20:24 -04:00
= 31fc1c369a still WIP 2018-04-12 12:03:07 -04:00
= 333fea4d18 merge conflicts 2018-04-11 21:08:37 -04:00
= ba6fa595c6 WIP - finding more issues with allowing dicts as filters 2018-04-11 20:54:16 -04:00
Chris Lenk 3e048ef325 Fix deprecated 3.6 backslash-character pairs
(https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior)
2018-04-11 15:46:17 -04:00
= 27647091a5 WIP - just at stash point 2018-04-11 13:36:52 -04:00
Chris Lenk b633fd3785 WIP: Allow custom observables, extensions 2018-04-10 12:54:27 -04:00
Chris Lenk 5c5ca1f21c Move 'extensions' property to custom Observables
... from custom Observable extensions (an extension doesn't need an
'extensions' property).
2018-04-09 15:35:08 -04:00
Chris Lenk b851afba01 Req. custom extension properties as list of tuples 2018-04-09 15:34:39 -04:00
Chris Lenk f83d9a56b5 Clean up documentation 2018-04-09 13:29:53 -04:00
Chris Lenk 1d06e642a4 Bump and pin nbsphinx version 2018-04-09 09:55:29 -04:00
Emmanuelle Vargas-Gonzalez 1ff640de3c Moved some test methods here 2018-04-06 14:24:15 -04:00
Emmanuelle Vargas-Gonzalez cd85683f2b WIP: Cleaned test_datastore to only include base store tests 2018-04-06 14:23:48 -04:00
Emmanuelle Vargas-Gonzalez 0d1729bbd7 Deleted test_filesystem in favor of test_datastore_filesystem.py 2018-04-06 14:20:39 -04:00
Emmanuelle Vargas-Gonzalez 80e4706ac4 Add some test objs previously in test_datastore.py 2018-04-06 14:19:51 -04:00
Emmanuelle Vargas-Gonzalez c2e7cbb3e3 Moved from test_datastore.py -> new file test_datastore_taxii.py 2018-04-06 14:18:05 -04:00
Emmanuelle Vargas-Gonzalez 59ff0c4f26 Moved from test_datastore.py -> new file test_datastore_memory.py 2018-04-06 14:17:49 -04:00
Emmanuelle Vargas-Gonzalez 5c4472cbbd Moved from test_datastore.py -> new file test_datastore_filters.py 2018-04-06 14:17:19 -04:00
Emmanuelle Vargas-Gonzalez 8f58f29358 Moved from test_datastore.py -> new file test_datastore_filesystem.py 2018-04-06 14:16:04 -04:00
Chris Lenk e6e72856b3 Remove query_by_type()
Missed these earlier.
2018-04-05 11:22:50 -04:00
Greg Back a1ad90d43f
Merge pull request #150 from oasis-open/38-workbench
Create Workbench layer
2018-04-05 10:09:23 -05:00
Chris Lenk e3bbc39353 Fix bug with mutable default parameter 2018-04-05 10:07:35 -04:00
Chris Lenk 589c00064b Remove query_by_type
It's not that much of a shortcut and we can add it back in later if it
makes sense.
2018-04-04 14:09:54 -04:00
Chris Lenk f951b9b09e Factor out dupl. code for creating list of filters 2018-04-04 13:50:41 -04:00
Greg Back f61bc5e5ee
Merge pull request #154 from oasis-open/code-coverage
Increase code coverage, fix patterning bugs
2018-04-03 15:11:15 -05:00
Greg Back 537dff9d2a
Merge pull request #153 from oasis-open/118-allow-generic-obj
118-allow generic obj and 135- split up parse()
2018-04-03 15:06:25 -05:00
Chris Lenk dd8f0f5c72 Increase code coverage slightly
An Environment will always have a CompositeDataSource, so there was no way
those exceptions could get raised.
2018-04-02 16:44:57 -04:00
Chris Lenk 3abfe7868a Add more patterning tests
... and fix bugs detected in doing so
2018-04-02 16:38:04 -04:00
Chris Lenk 940afb0012 Require a type when querying by type 2018-04-02 09:54:22 -04:00
Emmanuelle Vargas-Gonzalez 0bb1bb37f1 Call parse() on stix_data
# Fix on MemorySource.load_from_file()
2018-04-02 07:40:25 -04:00
= 90834c5b95 docs and tests for parse() mod 2018-03-30 13:21:07 -04:00
Chris Lenk d453bf6f1a Add a couple granular markings tests 2018-03-30 13:12:51 -04:00
Chris Lenk 4a2ac6df3a Add/fix workbench docs, rename add() -> save() 2018-03-30 12:04:31 -04:00
Chris Lenk 98cc86eef6 Fix workbench wrapped classes for `parse()`.
The wrapped classes need to be in the OBJ_MAP mapping, not just the
workbench.py globals.
2018-03-30 12:04:31 -04:00
Chris Lenk b9bbd03481 Update workbench imports and documentation
Import a bunch of stuff so users can just "from stix2.workbench import *" and
not need to import other stuff (e.g. MarkingDefinition, Cyber Observable
Object classes, etc.) from stix2.
2018-03-30 12:04:31 -04:00
Chris Lenk efede51453 Skip documenting some workbench stuff 2018-03-30 12:04:31 -04:00
Chris Lenk e48e0886a8 Improve code coverage slightly
Environment will always have a CompositeDataSource, so the try/catches
in add_filter/s did not make sense.
2018-03-30 12:02:27 -04:00
Chris Lenk 4fb24f14de Allow passing add'l filters to related_to() 2018-03-30 12:02:27 -04:00
Chris Lenk 61733ad899 Add functions to set ObjectFactory default values 2018-03-30 12:02:27 -04:00
Chris Lenk fd6d9f74e9 Move query_by_type() to DataStoreMixin 2018-03-30 12:02:27 -04:00
Chris Lenk eeb94562f9 Clean up DataStore return value documentation 2018-03-30 12:02:27 -04:00
Chris Lenk 53c2d4fadf Allow add'l filters in workbench query functions 2018-03-30 12:02:27 -04:00
Chris Lenk e91b71f300 Test adding a data source to the workbench 2018-03-30 12:02:27 -04:00
Chris Lenk 5285934034 Make Workbench use implicit ObjectFactory
This is needed to implement functions like `set_default_creator`.

The changes to Tox are so that the wrapping we do in workbench doesn't
affect the rest of our tests. If we test them all in one go, pytest will
import all the tests before running any of them. This will cause the
workbench versions of the SDO classes to be used in all tests.
2018-03-30 12:02:27 -04:00
Chris Lenk b2613ca62c Add Workbench wrapper functions 2018-03-30 12:02:27 -04:00
Chris Lenk aeff8f4bc0 Create Workbench layer
Contains a default implicit Environment and functions to get all objects
a specific type.
2018-03-30 12:02:27 -04:00
= 89cf4bc38f WIP:allow unknown custom objects to be processed by parse; WIP: splitting up parse utility into components; found bug in tests that wasnt providing for proper teardown cleaning, fixed 2018-03-29 11:49:30 -04:00
Greg Back e92db2417a
Merge pull request #147 from oasis-open/119-taxii-filters
119 taxii filters
2018-03-28 15:24:28 -05:00
= 51dcd6c184 same as last commit 2018-03-22 11:46:49 -04:00
= b1579ae265 same as last commit 2018-03-22 11:36:35 -04:00
= 9f19245c8a modify tests for python 3.x acceptance 2018-03-22 11:23:48 -04:00
= 536e56836c adding Filter check when the Filter property is 'type', checks the value has no underscores (issue #136) 2018-03-22 10:59:07 -04:00
Michael K 383bf5755e
remove debug line 2018-03-21 22:06:46 -04:00
= 7880e4a89b passing TAXII query params in correct format to taxii2client; patching bug where TAXII query filters were being applied again locally to STIX objects via Filters (which doesnt work) 2018-03-21 17:19:05 -04:00
Greg Back 3c2d877bc3
Merge pull request #145 from oasis-open/138-non-json-files
138 non json files
2018-03-21 13:37:27 -05:00
Emmanuelle Vargas-Gonzalez eeb34ebbef Change logic for case `isinstance(stix_data, list)`` 2018-03-19 12:03:25 -04:00
Emmanuelle Vargas-Gonzalez 32cb62cca2 Make sure we return if there is nothing to add to the collection 2018-03-19 11:00:09 -04:00
Chris Lenk 4e5eb88458 Increase versioning code coverage slightly 2018-03-16 16:38:29 -04:00
Emmanuelle Vargas-Gonzalez c98abb18f5 Fix docs 2018-03-16 14:26:41 -04:00
Emmanuelle Vargas-Gonzalez 7f9a3c49ea Update TAXIICollectionSink.add() to use serialize(). Call parse() on dict objects. Pass UTF-8 strings to taxii2client. closes #134 2018-03-15 13:51:47 -04:00
= 2fbde05e6c putting test files in stix type folder that exists on git (bc there are files in it) 2018-03-14 19:34:07 -04:00
= f4558c0958 pre-commit errors 2018-03-14 19:09:25 -04:00
= 6f762e7ea0 woops forgot file, recommit of: more type checking of filesystem json files; added corresponding tests 2018-03-14 16:32:31 -04:00
= af14cd4f88 more type checking of filesystem json files; added corresponding tests 2018-03-14 16:28:44 -04:00
Greg Back 5820fa0845 GH-138: ignore invalid JSON files. 2018-03-14 10:06:23 -05:00
Chris Lenk 955cad8385 Clarify serialization in documentation 2018-03-13 16:01:42 -04:00
Chris Lenk f9523f24bf Bump version: 0.5.0 → 0.5.1 2018-03-06 12:05:53 -05:00
Chris Lenk 35679e6a6b Bump version: 0.4.0 → 0.5.0 2018-03-06 11:45:06 -05:00
Chris Lenk 5a71ef2e64 Fix allow_custom in functions calling new_version 2018-03-02 11:32:07 -05:00
Chris Lenk 1eab9b2832 Assume custom properties allowable in add_markings 2018-03-02 10:21:51 -05:00