From 43a1ddb714823136c41983a6f13bea3c9e304de5 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 1 Sep 2022 13:38:31 +0200 Subject: [PATCH] Agent: Rename on_potential_new_user to add_potential_user --- monkey/infection_monkey/tcp_relay.py | 2 +- .../messengers/exploit_intercepting_telemetry_messenger.py | 2 +- monkey/tests/unit_tests/infection_monkey/test_tcp_relay.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/tcp_relay.py b/monkey/infection_monkey/tcp_relay.py index 812c4e6e3..ce6d405bf 100644 --- a/monkey/infection_monkey/tcp_relay.py +++ b/monkey/infection_monkey/tcp_relay.py @@ -79,7 +79,7 @@ class TCPRelay(Thread): with self._lock: return self._relay_users.copy() - def on_potential_new_user(self, user_address: IPv4Address): + def add_potential_user(self, user_address: IPv4Address): """ Notify TCPRelay that a new user may try and connect. diff --git a/monkey/infection_monkey/telemetry/messengers/exploit_intercepting_telemetry_messenger.py b/monkey/infection_monkey/telemetry/messengers/exploit_intercepting_telemetry_messenger.py index 0d1f4127c..60bd464b7 100644 --- a/monkey/infection_monkey/telemetry/messengers/exploit_intercepting_telemetry_messenger.py +++ b/monkey/infection_monkey/telemetry/messengers/exploit_intercepting_telemetry_messenger.py @@ -41,6 +41,6 @@ def _( if telemetry.propagation_result is True: tunnel.set_wait_for_exploited_machines() if relay: - relay.on_potential_new_user(str(telemetry.host["ip_addr"])) + relay.add_potential_user(str(telemetry.host["ip_addr"])) telemetry_messenger.send_telemetry(telemetry) diff --git a/monkey/tests/unit_tests/infection_monkey/test_tcp_relay.py b/monkey/tests/unit_tests/infection_monkey/test_tcp_relay.py index 17d5c84b2..ab8c7c632 100644 --- a/monkey/tests/unit_tests/infection_monkey/test_tcp_relay.py +++ b/monkey/tests/unit_tests/infection_monkey/test_tcp_relay.py @@ -57,7 +57,7 @@ def test_user_removed_on_request(tcp_relay): # new_user = "0.0.0.1" # relay.start() -# relay.on_potential_new_user(new_user) +# relay.add_potential_user(new_user) # relay.stop() # assert not join_or_kill_thread(relay, 0.1) # Should be waiting