#2769 - Clean up incorrect names and commented out code [skip ci]

This commit is contained in:
Marek Wolan
2024-08-19 10:28:39 +01:00
parent d74227e34f
commit aeca5fb6a2
3 changed files with 2 additions and 32 deletions

View File

@@ -1201,7 +1201,7 @@ class ActionManager:
"CONFIGURE_DOSBOT": ConfigureDoSBotAction,
"NODE_ACCOUNTS_CHANGE_PASSWORD": NodeAccountsChangePasswordAction,
"SSH_TO_REMOTE": NodeSessionsRemoteLoginAction,
"SSH_LOGOUT_LOGOUT": NodeSessionsRemoteLogoutAction,
"SESSIONS_REMOTE_LOGOFF": NodeSessionsRemoteLogoutAction,
"NODE_SEND_REMOTE_COMMAND": NodeSendRemoteCommandAction,
}
"""Dictionary which maps action type strings to the corresponding action class."""

View File

@@ -164,36 +164,6 @@ class Terminal(Service):
def _init_request_manager(self) -> RequestManager:
"""Initialise Request manager."""
rm = super()._init_request_manager()
# rm.add_request(
# "send",
# request_type=RequestType(func=lambda request, context: RequestResponse.from_bool(self.send())),
# )
# def _login(request: RequestFormat, context: Dict) -> RequestResponse:
# login = self._process_local_login(username=request[0], password=request[1])
# if login:
# return RequestResponse(
# status="success",
# data={
# "ip_address": login.ip_address,
# },
# )
# else:
# return RequestResponse(status="failure", data={"reason": "Invalid login credentials"})
#
# rm.add_request(
# "Login",
# request_type=RequestType(func=_login),
# )
# def _logoff(request: RequestFormat, context: Dict) -> RequestResponse:
# """Logoff from connection."""
# connection_uuid = request[0]
# self.parent.user_session_manager.local_logout(connection_uuid)
# self._disconnect(connection_uuid)
# return RequestResponse(status="success", data={})
#
# rm.add_request("Logoff", request_type=RequestType(func=_logoff))
def _remote_login(request: RequestFormat, context: Dict) -> RequestResponse:
login = self._send_remote_login(username=request[0], password=request[1], ip_address=request[2])

View File

@@ -460,7 +460,7 @@ def game_and_agent():
{"type": "NETWORK_PORT_DISABLE"},
{"type": "NODE_ACCOUNTS_CHANGE_PASSWORD"},
{"type": "SSH_TO_REMOTE"},
{"type": "SSH_LOGOUT_LOGOUT"},
{"type": "SESSIONS_REMOTE_LOGOFF"},
{"type": "NODE_SEND_REMOTE_COMMAND"},
]