File: //usr/local/CyberPanel/lib64/python3.10/site-packages/asyncssh/__pycache__/server.cpython-310.pyc
o
�h� � @ s� d Z ddlmZmZmZmZ ddlmZmZ ddl m
Z
ddlmZ ddl
mZ ddlmZmZ er`dd lmZmZ dd
lmZ ddlmZmZmZ ddlmZ dd
lmZmZmZ ddlmZ ee ded eeded f edef f Z!ee ded eeded f edef f Z"ee ded eeded f edef f Z#ee ded eeded f edef f Z$ee dee
f Z%ee ee
f Z&G dd� d�Z'dS )zSSH server protocol handler� )�
TYPE_CHECKING�Optional�Tuple�Union� )�KbdIntChallenge�KbdIntResponse)�SSHListener)�
MaybeAwait)�SSHKey)�SSHSocketSessionFactory�SSHServerSessionFactory)�SSHClientConnection�SSHServerConnection)�SSHAcceptHandler)�SSHServerChannel�
SSHTCPChannel�SSHUNIXChannel)�SSHTunTapChannel)�SSHServerSession�
SSHTCPSession�SSHUNIXSession)�SSHTunTapSessionr r r r r r r r r r c
@ sd e Zd ZdZdTdd�Zdee ddfd d
�Zdeded
e ddfdd�Z
dedee fdd�Zded fdd�Z
dedededee fdd�Zde fdd�Zdedededede f
dd �Zdedededede f
d!d"�Zdeded#edee fd$d%�Zde fd&d'�Zdededee fd(d)�Zdededee fd*d+�Zde fd,d-�Zded.edee fd/d0�Zded1ed2edee fd3d4�Zde fd5d6�Zdeded7edee fd8d9�Zded:edee fd;d<�Zdee fd=d>�Z!d?ed@edAedBede"f
dCdD�Z#dEedFedee$ fdGdH�Z%dIede&fdJdK�Z'dLedee( fdMdN�Z)dOee de*fdPdQ�Z+dOee de*fdRdS�Z,dS )U� SSHServerau SSH server protocol handler
Applications may subclass this when implementing an SSH server to
provide custom authentication and request handlers.
Whenever a new SSH server connection is accepted, a corresponding
SSHServer object is created and the method :meth:`connection_made`
is called, passing in the :class:`SSHServerConnection` object.
When the connection is closed, the method :meth:`connection_lost`
is called with an exception representing the reason for the
disconnect, or `None` if the connection was closed cleanly.
The method :meth:`begin_auth` can be overridden decide whether
or not authentication is required, and additional callbacks are
provided for each form of authentication in cases where authentication
information is not provided in the call to :func:`create_server`.
In addition, the methods :meth:`session_requested`,
:meth:`connection_requested`, :meth:`server_requested`,
:meth:`unix_connection_requested`, or :meth:`unix_server_requested`
can be overridden to handle requests to open sessions or direct
connections or set up listeners for forwarded connections.
.. note:: The authentication callbacks described here can be
defined as coroutines. However, they may be cancelled if
they are running when the SSH connection is closed by
the client. If they attempt to catch the CancelledError
exception to perform cleanup, they should make sure to
re-raise it to allow AsyncSSH to finish its own cleanup.
�connr �returnNc C � dS )aF Called when a connection is made
This method is called when a new TCP connection is accepted. The
`conn` parameter should be stored if needed for later use.
:param conn:
The connection which was successfully opened
:type conn: :class:`SSHServerConnection`
N� )�selfr r r �E/usr/local/CyberPanel/lib/python3.10/site-packages/asyncssh/server.py�connection_madef � zSSHServer.connection_made�excc C r )a Called when a connection is lost or closed
This method is called when a connection is closed. If the
connection is shut down cleanly, *exc* will be `None`.
Otherwise, it will be an exception explaining the reason for
the disconnect.
Nr )r r"