#2712 - Commit before merging in changes on dev
This commit is contained in:
@@ -56,6 +56,7 @@ class SSHConnectionMessage(IntEnum):
|
|||||||
SSH_MSG_CHANNEL_CLOSE = 87
|
SSH_MSG_CHANNEL_CLOSE = 87
|
||||||
"""Closes the channel."""
|
"""Closes the channel."""
|
||||||
|
|
||||||
|
|
||||||
class SSHUserCredentials(DataPacket):
|
class SSHUserCredentials(DataPacket):
|
||||||
"""Hold Username and Password in SSH Packets"""
|
"""Hold Username and Password in SSH Packets"""
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,12 @@ class Terminal(Service):
|
|||||||
_login_valid = Terminal._LoginValidator(terminal=self)
|
_login_valid = Terminal._LoginValidator(terminal=self)
|
||||||
|
|
||||||
rm = super()._init_request_manager()
|
rm = super()._init_request_manager()
|
||||||
rm.add_request("login", request_type=RequestType(func=lambda request, context: RequestResponse.from_bool(self._validate_login()), validator=_login_valid))
|
rm.add_request(
|
||||||
|
"login",
|
||||||
|
request_type=RequestType(
|
||||||
|
func=lambda request, context: RequestResponse.from_bool(self._validate_login()), validator=_login_valid
|
||||||
|
),
|
||||||
|
)
|
||||||
return rm
|
return rm
|
||||||
|
|
||||||
def _validate_login(self, user_account: Optional[str]) -> bool:
|
def _validate_login(self, user_account: Optional[str]) -> bool:
|
||||||
@@ -131,8 +136,7 @@ class Terminal(Service):
|
|||||||
@property
|
@property
|
||||||
def fail_message(self) -> str:
|
def fail_message(self) -> str:
|
||||||
"""Message that is reported when a request is rejected by this validator"""
|
"""Message that is reported when a request is rejected by this validator"""
|
||||||
return ("Cannot perform request on terminal as not logged in.")
|
return "Cannot perform request on terminal as not logged in."
|
||||||
|
|
||||||
|
|
||||||
# %% Inbound
|
# %% Inbound
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user