o
    gF                     @   s   d dl Z G dd deZG dd deZG dd deZG dd	 d	eZG d
d deZG dd deZG dd deZG dd deZ	G dd deZ
G dd deZG dd de jZG dd deZG dd deZG dd deZdS )    Nc                   @      e Zd ZdZdS )SSHExceptionzT
    Exception raised by failures in SSH2 protocol negotiation or logic errors.
    N__name__
__module____qualname____doc__ r	   r	   P/var/www/html/api-tag/env/lib/python3.10/site-packages/paramiko/ssh_exception.pyr          r   c                   @   r   )AuthenticationExceptionz
    Exception raised when authentication failed for some reason.  It may be
    possible to retry with different credentials.  (Other classes specify more
    specific reasons.)

    .. versionadded:: 1.6
    Nr   r	   r	   r	   r
   r      s    r   c                   @   r   )PasswordRequiredExceptionzR
    Exception raised when a password is needed to unlock a private key file.
    Nr   r	   r	   r	   r
   r   *   r   r   c                   @   $   e Zd ZdZg Zdd Zdd ZdS )BadAuthenticationTypez
    Exception raised when an authentication type (like password) is used, but
    the server isn't allowing that type.  (It may only allow public-key, for
    example.)

    .. versionadded:: 1.1
    c                 C      t | || || _|| _d S N)r   __init__explanationallowed_types)selfr   typesr	   r	   r
   r   >   s   
zBadAuthenticationType.__init__c                 C      d | j| jS )Nz{}; allowed types: {!r})formatr   r   r   r	   r	   r
   __str__E      zBadAuthenticationType.__str__Nr   r   r   r   r   r   r   r	   r	   r	   r
   r   2   s
    r   c                   @   r   )PartialAuthenticationzM
    An internal exception thrown in the case of partial authentication.
    c                 C   s   t | | || _d S r   )r   r   r   )r   r   r	   r	   r
   r   R   s   
zPartialAuthentication.__init__c                 C   s   d | jS )Nz+Partial authentication; allowed types: {!r})r   r   r   r	   r	   r
   r   V   s   zPartialAuthentication.__str__Nr   r	   r	   r	   r
   r   K   s
    r   c                   @   s   e Zd ZdS )UnableToAuthenticateN)r   r   r   r	   r	   r	   r
   r   ]   s    r   c                   @       e Zd ZdZdd Zdd ZdS )ChannelExceptionz
    Exception raised when an attempt to open a new `.Channel` fails.

    :param int code: the error code returned by the server

    .. versionadded:: 1.6
    c                 C   r   r   )r   r   codetext)r   r!   r"   r	   r	   r
   r   j      
zChannelException.__init__c                 C   r   )NzChannelException({!r}, {!r}))r   r!   r"   r   r	   r	   r
   r   o   s   zChannelException.__str__Nr   r   r   r   r   r   r	   r	   r	   r
   r    a   s    r    c                   @   r   )BadHostKeyExceptiona  
    The host key given by the SSH server did not match what we were expecting.

    :param str hostname: the hostname of the SSH server
    :param PKey got_key: the host key presented by the server
    :param PKey expected_key: the host key expected

    .. versionadded:: 1.6
    c                 C   s&   t | ||| || _|| _|| _d S r   )r   r   hostnamekeyexpected_key)r   r&   got_keyr(   r	   r	   r
   r   ~   s   
zBadHostKeyException.__init__c                 C   s    d}| | j| j | j S )Nz@Host key for server '{}' does not match: got '{}', expected '{}')r   r&   r'   
get_base64r(   )r   msgr	   r	   r
   r      s   zBadHostKeyException.__str__Nr$   r	   r	   r	   r
   r%   s   s    
r%   c                   @   r   )IncompatiblePeerzk
    A disagreement arose regarding an algorithm required for key exchange.

    .. versionadded:: 2.9
    Nr   r	   r	   r	   r
   r,      s    r,   c                   @   r   )ProxyCommandFailurez
    The "ProxyCommand" found in the .ssh/config file returned an error.

    :param str command: The command line that is generating this exception.
    :param str error: The error captured from the proxy command output.
    c                 C   r   r   )r   r   commanderror)r   r.   r/   r	   r	   r
   r      r#   zProxyCommandFailure.__init__c                 C   r   )Nz3ProxyCommand("{}") returned nonzero exit status: {})r   r.   r/   r   r	   r	   r
   r      r   zProxyCommandFailure.__str__Nr$   r	   r	   r	   r
   r-      s    r-   c                       s(   e Zd ZdZ fddZdd Z  ZS )NoValidConnectionsErrora  
    Multiple connection attempts were made and no families succeeded.

    This exception class wraps multiple "real" underlying connection errors,
    all of which represent failed connection attempts. Because these errors are
    not guaranteed to all be of the same error type (i.e. different errno,
    `socket.error` subclass, message, etc) we expose a single unified error
    message and a ``None`` errno so that instances of this class match most
    normal handling of `socket.error` objects.

    To see the wrapped exception objects, access the ``errors`` attribute.
    ``errors`` is a dict whose keys are address tuples (e.g. ``('127.0.0.1',
    22)``) and whose values are the exception encountered trying to connect to
    that address.

    It is implied/assumed that all the errors given to a single instance of
    this class are from connecting to the same hostname + port (and thus that
    the differences are in the resolution of the hostname - e.g. IPv4 vs v6).

    .. versionadded:: 1.16
    c                    sl   t | }ddd |dd D }|d d }|rd}nd}t d||d d	 || || _dS )
zl
        :param dict errors:
            The errors dict to store, as described by class docstring.
        z, c                 S   s   g | ]}|d  qS )r   r	   ).0xr	   r	   r
   
<listcomp>   s    z4NoValidConnectionsError.__init__.<locals>.<listcomp>Nr   z+Unable to connect to port {0} on {1} or {2}z$Unable to connect to port {0} on {2}   )sortedkeysjoinsuperr   r   errors)r   r:   addrsbodytailr+   	__class__r	   r
   r      s   
z NoValidConnectionsError.__init__c                 C   s   | j | jffS r   )r?   r:   r   r	   r	   r
   
__reduce__   s   z"NoValidConnectionsError.__reduce__)r   r   r   r   r   r@   __classcell__r	   r	   r>   r
   r0      s    r0   c                   @   r   )CouldNotCanonicalizezh
    Raised when hostname canonicalization fails & fallback is disabled.

    .. versionadded:: 2.7
    Nr   r	   r	   r	   r
   rB          rB   c                   @   r   )ConfigParseErrora@  
    A fatal error was encountered trying to parse SSH config data.

    Typically this means a config file violated the ``ssh_config``
    specification in a manner that requires exiting immediately, such as not
    matching ``key = value`` syntax or misusing certain ``Match`` keywords.

    .. versionadded:: 2.7
    Nr   r	   r	   r	   r
   rD      s    
rD   c                   @   r   )MessageOrderErrorzo
    Out-of-order protocol messages were received, violating "strict kex" mode.

    .. versionadded:: 3.4
    Nr   r	   r	   r	   r
   rE      rC   rE   )socket	Exceptionr   r   r   r   r   r   r    r%   r,   r-   r/   r0   rB   rD   rE   r	   r	   r	   r
   <module>   s   ,
