forked from p15670423/monkey
Island: Add agent_event_handlers
This commit is contained in:
parent
26fc6fd5b9
commit
5a836daaa7
|
@ -1,2 +1,3 @@
|
||||||
from .pywsgi_logging_filter import PyWSGILoggingFilter
|
from .pywsgi_logging_filter import PyWSGILoggingFilter
|
||||||
from .island_event_handlers import setup_island_event_handlers
|
from .island_event_handlers import setup_island_event_handlers
|
||||||
|
from .agent_event_handlers import setup_agent_event_handlers
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
from common import DIContainer
|
||||||
|
from common.event_queue import IAgentEventQueue
|
||||||
|
from monkey_island.cc.agent_event_subscribers import save_event_to_event_repository
|
||||||
|
from monkey_island.cc.repository import IEventRepository
|
||||||
|
|
||||||
|
|
||||||
|
def setup_agent_event_handlers(container: DIContainer):
|
||||||
|
_subscribe_and_store_to_event_repository(container)
|
||||||
|
|
||||||
|
|
||||||
|
def _subscribe_and_store_to_event_repository(container: DIContainer):
|
||||||
|
agent_event_queue = container.resolve(IAgentEventQueue)
|
||||||
|
|
||||||
|
event_repository = container.resolve(IEventRepository)
|
||||||
|
save_event_subscriber = save_event_to_event_repository(event_repository)
|
||||||
|
agent_event_queue.subscribe_all_events(save_event_subscriber)
|
Loading…
Reference in New Issue