File tree 3 files changed +10
-7
lines changed
misp_stix_converter/stix2misp
3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 3
3
4
4
from .. import Mapping
5
5
from .stix2_mapping import STIX2toMISPMapping
6
+ from typing import Union
6
7
7
8
8
9
class ExternalSTIX2toMISPMapping (STIX2toMISPMapping ):
@@ -122,13 +123,13 @@ def object_type_refs_to_skip(cls) -> tuple:
122
123
return cls .__object_type_refs_to_skip
123
124
124
125
@classmethod
125
- def observable_mapping (cls , field : str ) -> str | None :
126
+ def observable_mapping (cls , field : str ) -> Union [ str , None ] :
126
127
return cls .__observable_mapping .get (field )
127
128
128
129
@classmethod
129
130
def opinion_mapping (cls , field : str ) -> int :
130
131
return cls .__opinion_mapping .get (field , 50 )
131
132
132
133
@classmethod
133
- def stix_object_loading_mapping (cls , field : str ) -> str | None :
134
+ def stix_object_loading_mapping (cls , field : str ) -> Union [ str , None ] :
134
135
return cls .__stix_object_loading_mapping .get (field )
Original file line number Diff line number Diff line change 3
3
4
4
from .. import Mapping
5
5
from .stix2_mapping import STIX2toMISPMapping
6
+ from typing import Union
6
7
7
8
8
9
class InternalSTIX2toMISPMapping (STIX2toMISPMapping ):
@@ -30,5 +31,5 @@ def object_type_refs_to_skip(cls) -> tuple:
30
31
return cls .__object_type_refs_to_skip
31
32
32
33
@classmethod
33
- def stix_object_loading_mapping (cls , field : str ) -> str | None :
34
+ def stix_object_loading_mapping (cls , field : str ) -> Union [ str , None ] :
34
35
return cls .__stix_object_loading_mapping .get (field )
Original file line number Diff line number Diff line change 3
3
4
4
from .. import Mapping
5
5
from abc import ABCMeta
6
+ from typing import Union
6
7
7
8
8
9
class STIX2toMISPMapping (metaclass = ABCMeta ):
@@ -103,15 +104,15 @@ class STIX2toMISPMapping(metaclass=ABCMeta):
103
104
}
104
105
105
106
@classmethod
106
- def bundle_to_misp_mapping (cls , field : str ) -> str | None :
107
+ def bundle_to_misp_mapping (cls , field : str ) -> Union [ str , None ] :
107
108
return cls .__bundle_to_misp_mapping .get (field )
108
109
109
110
@classmethod
110
- def identity_references (cls , identity_id : str ) -> str | None :
111
+ def identity_references (cls , identity_id : str ) -> Union [ str , None ] :
111
112
return cls .__identity_references .get (identity_id )
112
113
113
114
@classmethod
114
- def marking_extension_mapping (cls , field : str ) -> str | None :
115
+ def marking_extension_mapping (cls , field : str ) -> Union [ str , None ] :
115
116
return cls .__marking_extension_mapping .get (field )
116
117
117
118
@classmethod
@@ -131,5 +132,5 @@ def stix_object_loading_mapping(cls) -> dict:
131
132
return cls .__stix_object_loading_mapping
132
133
133
134
@classmethod
134
- def stix_to_misp_mapping (cls , field : str ) -> str | None :
135
+ def stix_to_misp_mapping (cls , field : str ) -> Union [ str , None ] :
135
136
return cls .__stix_to_misp_mapping .get (field )
You can’t perform that action at this time.
0 commit comments