forked from p15670423/monkey
Agent: Move subscribtion to a separate method for readability
This commit is contained in:
parent
2a94a67767
commit
706a626d24
|
@ -206,10 +206,7 @@ class InfectionMonkey:
|
||||||
credentials_store = AggregatingPropagationCredentialsRepository(control_channel)
|
credentials_store = AggregatingPropagationCredentialsRepository(control_channel)
|
||||||
|
|
||||||
event_queue = PyPubSubEventQueue(Publisher())
|
event_queue = PyPubSubEventQueue(Publisher())
|
||||||
event_queue.subscribe_type(
|
InfectionMonkey._subscribe_events(event_queue, credentials_store)
|
||||||
CredentialsStolenEvent,
|
|
||||||
add_credentials_from_event_to_propagation_credentials_repository(credentials_store),
|
|
||||||
)
|
|
||||||
|
|
||||||
puppet = self._build_puppet(credentials_store, event_queue)
|
puppet = self._build_puppet(credentials_store, event_queue)
|
||||||
|
|
||||||
|
@ -232,6 +229,15 @@ class InfectionMonkey:
|
||||||
credentials_store,
|
credentials_store,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _subscribe_events(
|
||||||
|
event_queue: IEventQueue, credentials_store: IPropagationCredentialsRepository
|
||||||
|
):
|
||||||
|
event_queue.subscribe_type(
|
||||||
|
CredentialsStolenEvent,
|
||||||
|
add_credentials_from_event_to_propagation_credentials_repository(credentials_store),
|
||||||
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_local_network_interfaces():
|
def _get_local_network_interfaces():
|
||||||
local_network_interfaces = get_local_network_interfaces()
|
local_network_interfaces = get_local_network_interfaces()
|
||||||
|
|
Loading…
Reference in New Issue