From c704d4a37ba0e89f20a3b89c455facf41607061d Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Fri, 16 Sep 2022 14:39:36 +0000 Subject: [PATCH] Island: Remove StubbedEventRepository --- .../monkey_island/cc/repository/__init__.py | 1 - .../cc/repository/stubbed_event_repository.py | 29 ------------------- vulture_allowlist.py | 7 +---- 3 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 monkey/monkey_island/cc/repository/stubbed_event_repository.py diff --git a/monkey/monkey_island/cc/repository/__init__.py b/monkey/monkey_island/cc/repository/__init__.py index f299ec503..2d46d352a 100644 --- a/monkey/monkey_island/cc/repository/__init__.py +++ b/monkey/monkey_island/cc/repository/__init__.py @@ -26,5 +26,4 @@ from .mongo_credentials_repository import MongoCredentialsRepository from .mongo_machine_repository import MongoMachineRepository from .mongo_agent_repository import MongoAgentRepository from .mongo_node_repository import MongoNodeRepository -from .stubbed_event_repository import StubbedEventRepository from .mongo_event_repository import MongoEventRepository diff --git a/monkey/monkey_island/cc/repository/stubbed_event_repository.py b/monkey/monkey_island/cc/repository/stubbed_event_repository.py deleted file mode 100644 index c4be4d058..000000000 --- a/monkey/monkey_island/cc/repository/stubbed_event_repository.py +++ /dev/null @@ -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 diff --git a/vulture_allowlist.py b/vulture_allowlist.py index 2843b4efb..40a2f5cdb 100644 --- a/vulture_allowlist.py +++ b/vulture_allowlist.py @@ -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.models import Report from monkey_island.cc.models.networkmap import Arc, NetworkMap -from monkey_island.cc.repository import ( - MongoAgentRepository, - MongoMachineRepository, - StubbedEventRepository, -) +from monkey_island.cc.repository import MongoAgentRepository, MongoMachineRepository 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_repository import IAgentRepository @@ -283,7 +279,6 @@ IEventRepository.get_events IFindingRepository.get_findings MongoAgentRepository MongoMachineRepository -StubbedEventRepository key_list simulation netmap