Skip to content

Commit

Permalink
Merge pull request #240 from openmorse/bugfix/182-do-not-allow-sdo-in…
Browse files Browse the repository at this point in the history
…-sco-obj-ref-prop

Bugfix/182 do not allow sdo in obj ref prop
  • Loading branch information
rpiazza authored Nov 8, 2024
2 parents 0abc03b + 73592de commit 765f3c3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stix2validator/schemas-2.1
21 changes: 21 additions & 0 deletions stix2validator/test/v21/observed_data_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,27 @@ def test_invalid_objects_property(self):
]
self.assertFalseWithOptions(observed_data)

def test_invalid_object_refs(self):
observed_data = copy.deepcopy(self.valid_observed_data)

observed_data['object_refs'] = [
"attack-pattern--efcd5e80-570d-4131-b213-62cb18eaa6a8",
"campaign--ecb120bf-2694-4902-a737-62b74539a41b"
]
self.assertFalseWithOptions(observed_data)

observed_data['object_refs'] = [
"ipv4-addr--efcd5e80-570d-4131-b213-62cb18eaa6a8",
"domain-name--ecb120bf-2694-4902-a737-62b74539a41b"
]
self.assertTrueWithOptions(observed_data)

observed_data['object_refs'] = [
"cabbage",
"banana"
]
self.assertFalseWithOptions(observed_data)

def test_url(self):
observed_data = {
"type": "url",
Expand Down

0 comments on commit 765f3c3

Please sign in to comment.