mirror of https://github.com/MISP/PyMISP
new: Add relationship_type in Tag entries for feeds
parent
687f1ee2e1
commit
024283ba01
|
@ -367,13 +367,14 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta):
|
||||||
|
|
||||||
class MISPTag(AbstractMISP):
|
class MISPTag(AbstractMISP):
|
||||||
|
|
||||||
_fields_for_feed: set = {'name', 'colour'}
|
_fields_for_feed: set = {'name', 'colour', 'relationship_type'}
|
||||||
|
|
||||||
def __init__(self, **kwargs: Dict):
|
def __init__(self, **kwargs: Dict):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
self.name: str
|
self.name: str
|
||||||
self.exportable: bool
|
self.exportable: bool
|
||||||
self.local: bool
|
self.local: bool
|
||||||
|
self.relationship_type: Optional[str]
|
||||||
|
|
||||||
def from_dict(self, **kwargs):
|
def from_dict(self, **kwargs):
|
||||||
if kwargs.get('Tag'):
|
if kwargs.get('Tag'):
|
||||||
|
@ -381,6 +382,8 @@ class MISPTag(AbstractMISP):
|
||||||
super().from_dict(**kwargs)
|
super().from_dict(**kwargs)
|
||||||
|
|
||||||
def _set_default(self):
|
def _set_default(self):
|
||||||
|
if not hasattr(self, 'relationship_type'):
|
||||||
|
self.relationship_type = None
|
||||||
if not hasattr(self, 'colour'):
|
if not hasattr(self, 'colour'):
|
||||||
self.colour = '#ffffff'
|
self.colour = '#ffffff'
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ from io import BytesIO
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Union, List, Tuple, Dict, cast, Any, Optional
|
from typing import Union, List, Tuple, Dict, cast, Any, Optional
|
||||||
|
|
||||||
from extract_msg import openMsg
|
from extract_msg import openMsg # type: ignore
|
||||||
from extract_msg.message import Message as MsgObj
|
from extract_msg.message import Message as MsgObj # type: ignore
|
||||||
from RTFDE.exceptions import MalformedEncapsulatedRtf, NotEncapsulatedRtf # type: ignore
|
from RTFDE.exceptions import MalformedEncapsulatedRtf, NotEncapsulatedRtf # type: ignore
|
||||||
from RTFDE.deencapsulate import DeEncapsulator # type: ignore
|
from RTFDE.deencapsulate import DeEncapsulator # type: ignore
|
||||||
from oletools.common.codepages import codepage2codec # type: ignore
|
from oletools.common.codepages import codepage2codec # type: ignore
|
||||||
|
|
Loading…
Reference in New Issue