Remove the stix2 internals reference

v20
This commit is contained in:
Shay Nehmad 2020-04-16 22:32:05 +03:00
parent cb9d4936dd
commit 7ef3c3b0a8
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
from typing import List, Dict
from stix2 import FileSystemSource, Filter, CourseOfAction, AttackPattern, v20
from stix2 import FileSystemSource, Filter, CourseOfAction, AttackPattern
class MitreApiInterface:
@ -32,14 +32,14 @@ class MitreApiInterface:
return all_techniques
@staticmethod
def get_stix2_external_reference_id(stix2_data: v20._DomainObject) -> str:
def get_stix2_external_reference_id(stix2_data) -> str:
for reference in stix2_data['external_references']:
if reference['source_name'] == "mitre-attack" and 'external_id' in reference:
return reference['external_id']
return ''
@staticmethod
def get_stix2_external_reference_url(stix2_data: v20._DomainObject) -> str:
def get_stix2_external_reference_url(stix2_data) -> str:
for reference in stix2_data['external_references']:
if 'url' in reference:
return reference['url']