forked from p15670423/monkey
Island: Subscribe ICredentialsRepository to CLEAR_SIMULATION_DATA
This commit is contained in:
parent
745027bf93
commit
9479b56722
|
@ -1,12 +1,14 @@
|
|||
from common import DIContainer
|
||||
from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic
|
||||
from monkey_island.cc.island_event_handlers import reset_agent_configuration
|
||||
from monkey_island.cc.repository import ICredentialsRepository
|
||||
|
||||
|
||||
def setup_island_event_handlers(container: DIContainer):
|
||||
event_queue = container.resolve(IIslandEventQueue)
|
||||
|
||||
_handle_reset_agent_configuration_events(event_queue, container)
|
||||
_handle_clear_simulation_data_events(event_queue, container)
|
||||
|
||||
|
||||
def _handle_reset_agent_configuration_events(
|
||||
|
@ -15,3 +17,11 @@ def _handle_reset_agent_configuration_events(
|
|||
event_queue.subscribe(
|
||||
IslandEventTopic.RESET_AGENT_CONFIGURATION, container.resolve(reset_agent_configuration)
|
||||
)
|
||||
|
||||
|
||||
def _handle_clear_simulation_data_events(event_queue: IIslandEventQueue, container: DIContainer):
|
||||
credentials_repository = container.resolve(ICredentialsRepository)
|
||||
|
||||
event_queue.subscribe(
|
||||
IslandEventTopic.CLEAR_SIMULATION_DATA, credentials_repository.remove_stolen_credentials
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue