diff --git a/monkey/infection_monkey/tcp_relay.py b/monkey/infection_monkey/tcp_relay.py index ce6d405bf..8cdb287c6 100644 --- a/monkey/infection_monkey/tcp_relay.py +++ b/monkey/infection_monkey/tcp_relay.py @@ -60,7 +60,7 @@ class TCPRelay(Thread): def stop(self): self._stopped.set() - def on_user_connected(self, user_address: IPv4Address): + def add_relay_user(self, user_address: IPv4Address): """ Handle new user connection. 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 ab8c7c632..c011ccd4f 100644 --- a/monkey/tests/unit_tests/infection_monkey/test_tcp_relay.py +++ b/monkey/tests/unit_tests/infection_monkey/test_tcp_relay.py @@ -35,7 +35,7 @@ def join_or_kill_thread(thread: Thread, timeout: float): def test_user_added(tcp_relay): - tcp_relay.on_user_connected(NEW_USER_ADDRESS) + tcp_relay.add_relay_user(NEW_USER_ADDRESS) users = tcp_relay.relay_users() assert len(users) == 1 @@ -43,7 +43,7 @@ def test_user_added(tcp_relay): def test_user_removed_on_request(tcp_relay): - tcp_relay.on_user_connected(NEW_USER_ADDRESS) + tcp_relay.add_relay_user(NEW_USER_ADDRESS) tcp_relay.on_user_data_received(RELAY_CONTROL_MESSAGE, NEW_USER_ADDRESS) users = tcp_relay.relay_users() diff --git a/vulture_allowlist.py b/vulture_allowlist.py index 9f10fdedf..a6b99952f 100644 --- a/vulture_allowlist.py +++ b/vulture_allowlist.py @@ -289,6 +289,7 @@ serialized_event # TODO: Remove after #2231 is closed relay_users last_update_time +add_relay_user # pydantic base models underscore_attrs_are_private