Island: Remove StubbedEventRepository

This commit is contained in:
Kekoa Kaaikala 2022-09-16 14:39:36 +00:00
parent dc1eeefbc1
commit c704d4a37b
3 changed files with 1 additions and 36 deletions

View File

@ -26,5 +26,4 @@ from .mongo_credentials_repository import MongoCredentialsRepository
from .mongo_machine_repository import MongoMachineRepository from .mongo_machine_repository import MongoMachineRepository
from .mongo_agent_repository import MongoAgentRepository from .mongo_agent_repository import MongoAgentRepository
from .mongo_node_repository import MongoNodeRepository from .mongo_node_repository import MongoNodeRepository
from .stubbed_event_repository import StubbedEventRepository
from .mongo_event_repository import MongoEventRepository from .mongo_event_repository import MongoEventRepository

View File

@ -1,29 +0,0 @@
from typing import Sequence, Type, TypeVar
from common.agent_events import AbstractAgentEvent
from common.types import AgentID
from . import IAgentEventRepository
T = TypeVar("T", bound=AbstractAgentEvent)
# TODO: Remove this class after #2180 is complete
class StubbedEventRepository(IAgentEventRepository):
def save_event(self, event: AbstractAgentEvent):
return
def get_events(self) -> Sequence[AbstractAgentEvent]:
return []
def get_events_by_type(self, event_type: Type[T]) -> Sequence[T]:
return []
def get_events_by_tag(self, tag: str) -> Sequence[AbstractAgentEvent]:
return []
def get_events_by_source(self, source: AgentID) -> Sequence[AbstractAgentEvent]:
return []
def reset(self):
return

View File

@ -12,11 +12,7 @@ from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFacto
from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue
from monkey_island.cc.models import Report from monkey_island.cc.models import Report
from monkey_island.cc.models.networkmap import Arc, NetworkMap from monkey_island.cc.models.networkmap import Arc, NetworkMap
from monkey_island.cc.repository import ( from monkey_island.cc.repository import MongoAgentRepository, MongoMachineRepository
MongoAgentRepository,
MongoMachineRepository,
StubbedEventRepository,
)
from monkey_island.cc.repository.attack.IMitigationsRepository import IMitigationsRepository from monkey_island.cc.repository.attack.IMitigationsRepository import IMitigationsRepository
from monkey_island.cc.repository.i_agent_event_repository import IAgentEventRepository from monkey_island.cc.repository.i_agent_event_repository import IAgentEventRepository
from monkey_island.cc.repository.i_agent_repository import IAgentRepository from monkey_island.cc.repository.i_agent_repository import IAgentRepository
@ -283,7 +279,6 @@ IEventRepository.get_events
IFindingRepository.get_findings IFindingRepository.get_findings
MongoAgentRepository MongoAgentRepository
MongoMachineRepository MongoMachineRepository
StubbedEventRepository
key_list key_list
simulation simulation
netmap netmap