Ë
    zñ�jâj  ã                   óð   — d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl	m
Z
 ddlmZ d\  ZZ	 ddlZddlmZmZ d	Z G d
„ d«      Zd„ Z G d„ d«      Z G d„ de«      Zy# e$ rZeZY dZ[Œ9dZ[ww xY w)z2
Configuration file (aka ``ssh_config``) support.
é    N)Úsha1)ÚStringIO)Úpartial)NNé   )ÚCouldNotCanonicalizeÚConfigParseErroré   c                   óâ   — e Zd ZdZ ej
                  d«      Zg d¢dgg d¢g d¢g d¢g d¢d	œZd
„ Ze	d„ «       Z
e	d„ «       Ze	d„ «       Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)Ú	SSHConfigaƒ  
    Representation of config information as stored in the format used by
    OpenSSH. Queries can be made via `lookup`. The format is described in
    OpenSSH's ``ssh_config`` man page. This class is provided primarily as a
    convenience to posix users (since the OpenSSH format is a de-facto
    standard on posix) but should work fine on Windows too.

    .. versionadded:: 1.6
    z(\w+)(?:\s*=\s*|\s+)(.+))ú%Cú%hú%lú%Lú%nú%pú%rú%ur   )r   ú~ú%dr   r   r   r   )r   r   r   r   )r   r   r   )	r   r   r   r   r   r   r   r   r   )ÚcontrolpathÚhostnameÚidentityfileÚproxycommandÚ	proxyjumpú
match-execc                 ó   — g | _         y)a†  
        Create a new OpenSSH config object.

        Note: the newer alternate constructors `from_path`, `from_file` and
        `from_text` are simpler to use, as they parse on instantiation. For
        example, instead of::

            config = SSHConfig()
            config.parse(open("some-path.config")

        you could::

            config = SSHConfig.from_file(open("some-path.config"))
            # Or more directly:
            config = SSHConfig.from_path("some-path.config")
            # Or if you have arbitrary ssh_config text from some other source:
            config = SSHConfig.from_text("Host foo\n\tUser bar")
        N)Ú_config)Úselfs    úP/var/www/api.ozpay.ru/ozpay/venv/lib/python3.12/site-packages/paramiko/config.pyÚ__init__zSSHConfig.__init__H   s   € ð& ˆ�ó    c                 ó6   — | j                  t        |«      «      S )zg
        Create a new, parsed `SSHConfig` from ``text`` string.

        .. versionadded:: 2.7
        )Ú	from_filer   )ÚclsÚtexts     r   Ú	from_textzSSHConfig.from_text]   s   € ð �}‰}œX d›^Ó,Ð,r!   c                 óf   — t        |«      5 }| j                  |«      cddd«       S # 1 sw Y   yxY w)zr
        Create a new, parsed `SSHConfig` from the file found at ``path``.

        .. versionadded:: 2.7
        N)Úopenr#   )r$   ÚpathÚflos      r   Ú	from_pathzSSHConfig.from_pathf   s.   € ô �$‹Zð 	&˜3Ø—=‘= Ó%÷	&÷ 	&ò 	&ús   Œ'§0c                 ó6   —  | «       }|j                  |«       |S )zp
        Create a new, parsed `SSHConfig` from file-like object ``flo``.

        .. versionadded:: 2.7
        )Úparse)r$   r*   Úobjs      r   r#   zSSHConfig.from_filep   s   € ñ ‹eˆØ�	‰	�#ŒØˆ
r!   c                 ó.  — dgi dœ}|D �]n  }|j                  «       }|r|j                  d«      rŒ(t        j                  | j                  |«      }|st        dj                  |«      «      ‚|j                  d«      j                  «       }|j                  d«      }|dv rN| j                  j                  |«       di i}|d	k(  r| j                  |«      |d	<   ŒÑ| j                  |«      |d
<   Œæ|dk(  r|j                  «       dk(  r
d|d   |<   �Œ|j                  d«      r|j                  d«      r|dd }|dv r+||d   v r|d   |   j                  |«       �ŒS|g|d   |<   �Œ^||d   vs�Œg||d   |<   �Œq | j                  j                  |«       y)zŽ
        Read an OpenSSH config from the given file object.

        :param file_obj: a file-like object to read the config file from
        Ú*)ÚhostÚconfigú#zUnparsable line {}r   é   )r1   Úmatchr2   r1   Úmatchesr   ÚnoneNú"éÿÿÿÿ)r   ÚlocalforwardÚremoteforward)ÚstripÚ
startswithÚrer5   ÚSETTINGS_REGEXr   ÚformatÚgroupÚlowerr   ÚappendÚ
_get_hostsÚ_get_matchesÚendswith)r   Úfile_objÚcontextÚliner5   ÚkeyÚvalues          r   r-   zSSHConfig.parse{   s§  € ð  ˜5¨BÑ/ˆØó /	3ˆDð —:‘:“<ˆDá˜4Ÿ?™?¨3Ô/Øô —H‘H˜T×0Ñ0°$Ó7ˆEÙÜ&Ð';×'BÑ'BÀ4Ó'HÓIÐIØ—+‘+˜a“.×&Ñ&Ó(ˆCØ—K‘K “NˆEð Ð'Ñ'Ø—‘×#Ñ# GÔ,Ø# R˜.�Ø˜&’=ð '+§o¡o°eÓ&<�G˜F’Oà)-×):Ñ):¸5Ó)A�G˜IÒ&à˜Ò&¨5¯;©;«=¸FÒ+Bð *.�˜Ñ! #Ó&ð ×#Ñ# CÔ(¨U¯^©^¸CÔ-@Ø! ! B˜K�Eð
 ÐKÑKØ˜g hÑ/Ñ/Ø Ñ)¨#Ñ.×5Ñ5°eÖ<à27°˜ Ñ)¨#Ó.Ø ¨Ñ 1Ó1Ø-2�G˜HÑ% cÓ*ð_/	3ðb 	�‰×Ñ˜GÕ$r!   c                 ót  — | j                  |¬«      }d|vr||d<   |j                  dd«      dv }t        |j                  dd«      «      }|rV|j                  d«      |k  rB|d	   j	                  «       }| j                  |||«      }||d<   | j                  ||d
d
¬«      }|S | j                  ||dd
¬«      }|S )a  
        Return a dict (`SSHConfigDict`) of config options for a given hostname.

        The host-matching rules of OpenSSH's ``ssh_config`` man page are used:
        For each parameter, the first obtained value will be used.  The
        configuration files contain sections separated by ``Host`` and/or
        ``Match`` specifications, and that section is only applied for hosts
        which match the given patterns or keywords

        Since the first obtained value for each parameter is used, more host-
        specific declarations should be given near the beginning of the file,
        and general defaults at the end.

        The keys in the returned dict are all normalized to lowercase (look for
        ``"port"``, not ``"Port"``. The values are processed according to the
        rules for substitution variable expansion in ``ssh_config``.

        Finally, please see the docs for `SSHConfigDict` for deeper info on
        features such as optional type conversion methods, e.g.::

            conf = my_config.lookup('myhost')
            assert conf['passwordauthentication'] == 'yes'
            assert conf.as_bool('passwordauthentication') is True

        .. note::
            If there is no explicitly configured ``HostName`` value, it will be
            set to the being-looked-up hostname, which is as close as we can
            get to OpenSSH's behavior around that particular option.

        :param str hostname: the hostname to lookup

        .. versionchanged:: 2.5
            Returns `SSHConfigDict` objects instead of dict literals.
        .. versionchanged:: 2.7
            Added canonicalization support.
        .. versionchanged:: 2.7
            Added ``Match`` support.
        .. versionchanged:: 3.3
            Added ``Match final`` support.
        )r   r   ÚcanonicalizehostnameN)ÚyesÚalwaysÚcanonicalizemaxdotsr   ú.ÚcanonicaldomainsT)Ú	canonicalÚfinalF)Ú_lookupÚgetÚintÚcountÚsplitÚcanonicalize)r   r   ÚoptionsÚcanonÚmaxdotsÚdomainss         r   ÚlookupzSSHConfig.lookup·   så   € ðT —,‘,¨�,Ó1ˆð ˜WÑ$Ø"*ˆG�JÑà—‘Ð2°DÓ9Ð=NÐNˆÜ�g—k‘kÐ"7¸Ó;Ó<ˆÙ�X—^‘^ CÓ(¨GÒ3ð Ð0Ñ1×7Ñ7Ó9ˆGØ×(Ñ(¨°7¸GÓDˆHà"*ˆG�JÑØ—l‘lØ˜'¨T¸ð #ó ˆGð ˆð —l‘lØ˜'¨U¸$ð #ó ˆGð ˆr!   Nc                 óœ  ‡‡— ‰€
t        «       Š| j                  D ]š  }| j                  |j                  dg «      |«      s&| j	                  |j                  dg «      |||‰«      sŒK|d   j                  «       D ]:  \  Š}‰‰vr|�|d d  n|‰‰<   Œ‰dk(  sŒ‰‰   j                  ˆˆfd„|D «       «       Œ< Œœ |r| j                  ‰|«      Š‰S )Nr1   r6   r2   r   c              3   ó2   •K  — | ]  }|‰‰   vsŒ|–— Œ y ­w©N© )Ú.0ÚxrJ   r[   s     €€r   ú	<genexpr>z$SSHConfig._lookup.<locals>.<genexpr>  s!   øè ø€ ò (Ø¨A°W¸S±\Ò,Aœñ(ùs   ƒ�)ÚSSHConfigDictr   Ú_pattern_matchesrV   Ú_does_matchÚitemsÚextendÚ_expand_variables)r   r   r[   rS   rT   rH   rK   rJ   s     `    @r   rU   zSSHConfig._lookupù   sð   ù€ àˆ?Ü#“oˆGð —|‘|ò 	ˆGà×%Ñ% g§k¡k°&¸"Ó&=¸xÔHØ×#Ñ#Ø—K‘K 	¨2Ó.ØØØØôð Ø% hÑ/×5Ñ5Ó7ò 
‘
��UØ˜gÑ%ð
 05Ð/@ 5©¡8Àe�G˜C’LØ˜NÓ*Ø˜C‘L×'Ñ'ô (Ø#(ô(õ ñ
ð	ñ. ð ×,Ñ,¨W°hÓ?ˆGØˆr!   c                 ó  — d}|D ]D  }dj                  ||«      }t        ||«      }|�|d   }n	 t        j                  |«      }|sŒB|c S  |j                  dd«      dk(  r|S t        |«      ‚# t        j                  $ r Y Œ?w xY w)ag  
        Return canonicalized version of ``hostname``.

        :param str hostname: Target hostname.
        :param options: An `SSHConfigDict` from a previous lookup pass.
        :param domains: List of domains (e.g. ``["paramiko.org"]``).

        :returns: A canonicalized hostname if one was found, else ``None``.

        .. versionadded:: 2.7
        Fz{}.{}r   ÚcanonicalizefallbacklocalrN   )r@   Ú_addressfamily_host_lookupÚsocketÚgethostbynameÚgaierrorrV   r   )r   r   r[   r^   ÚfoundÚdomainÚ	candidateÚfamily_specifics           r   rZ   zSSHConfig.canonicalize  s¨   € ð ˆØò 	!ˆFØŸ™ x°Ó8ˆIÜ8¸ÀGÓLˆOØÐ*ð (¨Ñ*‘ðÜ"×0Ñ0°Ó;�Eò ð !Ò ð%	!ð, �;‰;Ð2°EÓ:¸eÒCØˆOô # 8Ó,Ð,øô —‘ò Ùðús   ¯A.Á.BÂBc                 ód   — t        «       }| j                  D ]  }|j                  |d   «       Œ |S )z‡
        Return the set of literal hostnames defined in the SSH config (both
        explicit hostnames and wildcard entries).
        r1   )Úsetr   Úupdate)r   ÚhostsÚentrys      r   Úget_hostnameszSSHConfig.get_hostnamesE  s3   € ô
 “ˆØ—\‘\ò 	(ˆEØ�L‰L˜˜v™Õ'ð	(àˆr!   c                 óÜ   — t        |d«      r|j                  d«      }d}|D ]G  }|j                  d«      rt        j                  ||dd  «      r yt        j                  ||«      sŒFd}ŒI |S )NrY   ú,Fú!r   T)ÚhasattrrY   r=   Úfnmatch)r   ÚpatternsÚtargetr5   Úpatterns        r   rh   zSSHConfig._pattern_matchesO  ss   € ä�8˜WÔ%Ø—~‘~ cÓ*ˆHØˆØò 		ˆGà×!Ñ! #Ô&¬7¯?©?Ø˜  ˜ô,ñ ô —‘ ¨Õ1Ø‘ð		ð ˆr!   c                 óÊ  — g }|d d  }t        j                  «       }|�rD|j                  d«      }	d }
|j                  dd «      }|j                  dd «      }|	d   |	d   }}|dk(  r| j	                  ||	«      ry|dk(  r|}
n¹|d	k(  ry
|dk(  r|xs |}| j                  ||«      }
n•|dk(  r| j                  ||«      }
n}|dk(  r|xs |}| j                  ||«      }
n_|dk(  r| j                  ||«      }
nG|dk(  rB| j                  ||d|«      }t        €t        ‚t        j                  |dd
¬«      j                  }
|
�| j	                  |
|	«      ry|j                  |	«       |r�ŒD|S )Nr   r   ÚuserÚtypeÚparamrS   FrT   ÚallTr1   ÚoriginalhostÚ	localuserÚexecr   Ústdout)ÚhideÚwarn)ÚgetpassÚgetuserÚpoprV   Ú_should_failrh   Ú	_tokenizeÚinvokeÚinvoke_import_errorÚrunÚokrC   )r   Ú
match_listÚtarget_hostnamerS   rT   r[   ÚmatchedÚ
candidatesÚlocal_usernameru   ÚpassedÚconfigured_hostÚconfigured_userÚtype_rˆ   Úhostvalr†   Úexec_cmds                     r   ri   zSSHConfig._does_match`  s�  € ð ˆØ¡�]ˆ
Ü Ÿ™Ó*ˆÚØ"Ÿ™ qÓ)ˆIØˆFð &Ÿk™k¨*°dÓ;ˆOØ%Ÿk™k¨&°$Ó7ˆOØ$ VÑ,¨i¸Ñ.@�5ˆEð ˜Ò#Ø×$Ñ$ Y°	Ô:Ø Ø˜ÒØ‘ð ˜%’Øð ˜&’Ø)Ò<¨_�Ø×.Ñ.¨u°gÓ>‘Ø˜.Ò(Ø×.Ñ.¨u°oÓF‘Ø˜&’Ø&Ò8¨.�Ø×.Ñ.¨u°dÓ;‘Ø˜+Ò%Ø×.Ñ.¨u°nÓE‘Ø˜&’ØŸ>™>Ø˜_¨l¸Eó�ô
 �>Ü-Ð-äŸ™ H°8À$ÔG×JÑJ�àÐ! d×&7Ñ&7¸À	Ô&JØà�N‰N˜9Ô%ó] ð` ˆr!   c                 ó   — |d   r|S | S )NÚnegaterc   )r   Ú
would_passru   s      r   r“   zSSHConfig._should_fail˜  s   € Ø& xÒ0ˆzÐD¸*°nÐDr!   c                 ód  — | j                  |«      }|s|S |}|dk7  r|j                  d|«      }d|v r|d   }nt        }t        j                  «       }d|v r|d   }	n|}	t        j                  «       j                  d«      d   }
t        ||
«      }t        j                  j                  d«      }|
|z   t        |«      z   |	z   }t        |j                  «       «      j                  «       |||
||||	||dœ
}|}|j!                  «       D ]%  \  }}||vrŒ|j#                  |t%        |«      «      }Œ' |S )a„  
        Tokenize a string based on current config/hostname data.

        :param config: Current config data.
        :param target_hostname: Original target connection hostname.
        :param key: Config key being tokenized (used to filter token list).
        :param value: Config value being tokenized.

        :returns: The tokenized version of the input ``value`` string.
        r   Úportr†   rQ   r   r   )
r   r   r   r   r   r   r   r   r   r   )Ú_allowed_tokensrV   ÚSSH_PORTr�   r‘   rp   ÚgethostnamerY   ÚLazyFqdnÚosr)   Ú
expanduserÚreprr   ÚencodeÚ	hexdigestrj   ÚreplaceÚstr)r   r2   rš   rJ   rK   Úallowed_tokensÚconfigured_hostnamer¨   r†   Ú
remoteuserÚlocal_hostnameÚ
local_fqdnÚhomedirÚtohashÚreplacementsÚ	tokenizedÚfindr²   s                     r   r”   zSSHConfig._tokenize›  sU  € ð ×-Ñ-¨cÓ2ˆáØˆLð .ÐØ�*ÒØ"(§*¡*¨ZÐ9LÓ"MÐà�VÑØ˜&‘>‰DäˆDÜ�‰Ó ˆØ�VÑØ ™‰JàˆJÜ×+Ñ+Ó-×3Ñ3°CÓ8¸Ñ;ˆÜ˜f nÓ5ˆ
Ü—'‘'×$Ñ$ SÓ)ˆØ /Ñ1´D¸³JÑ>ÀÑKˆô �v—}‘}“Ó'×1Ñ1Ó3ØØ%à Øð "ØØàØñ
ˆð$ ˆ	Ø)×/Ñ/Ó1ò 	>‰MˆD�'Ø˜>Ñ)ØØ!×)Ñ)¨$´°G³Ó=‰Ið	>ð
 Ðr!   c                 ó:   — | j                   j                  |g «      S )aJ  
        Given config ``key``, return list of token strings to tokenize.

        .. note::
            This feels like it wants to eventually go away, but is used to
            preserve as-strict-as-possible compatibility with OpenSSH, which
            for whatever reason only applies some tokens to some config keys.
        )ÚTOKENS_BY_CONFIG_KEYrV   ©r   rJ   s     r   r©   zSSHConfig._allowed_tokensÙ  s   € ð ×(Ñ(×,Ñ,¨S°"Ó5Ð5r!   c                 óÜ   — |D ]f  }||   €Œ	t        | j                  |||«      }t        ||   t        «      r%t	        ||   «      D ]  \  }} ||«      ||   |<   Œ ŒY |||   «      ||<   Œh |S )aA  
        Return a dict of config options with expanded substitutions
        for a given original & current target hostname.

        Please refer to :doc:`/api/config` for details.

        :param dict config: the currently parsed config
        :param str hostname: the hostname whose config is being looked up
        )r   r”   Ú
isinstanceÚlistÚ	enumerate)r   r2   rš   ÚkÚ	tokenizerÚirK   s          r   rl   zSSHConfig._expand_variablesä  s‹   € ð ò 	1ˆAØ�a‰yÐ ØÜ §¡°¸ÈÓKˆIÜ˜& ™)¤TÔ*Ü )¨&°©)Ó 4ò 4‘H�A�uÙ#,¨UÓ#3�F˜1‘I˜a’Lñ4ñ & f¨Q¡iÓ0��q’	ð	1ð ˆr!   c                 ó|   — 	 t        j                  |«      S # t        $ r t        dj	                  |«      «      ‚w xY w)z>
        Return a list of host_names from host value.
        zUnparsable host {})ÚshlexrY   Ú
ValueErrorr   r@   )r   r1   s     r   rD   zSSHConfig._get_hostsù  s?   € ð	FÜ—;‘;˜tÓ$Ð$øÜò 	FÜ"Ð#7×#>Ñ#>¸tÓ#DÓEÐEð	Fús   ‚ —$;c                 ó‚  ‡
— g }t        j                  |«      }|r‘ddddœ}|j                  d«      }|j                  d«      r
d|d<   |dd }||d	<   |d
v r|j	                  |«       ŒO|st        dj                  |«      «      ‚|j                  d«      |d<   |j	                  |«       |rŒ‘|D �cg c]  }|d	   ‘Œ	 }}d|v rxdŠ
t        t        ˆ
fd„|«      «      t        t        ˆ
fd„|«      «      }}d}	t        |«      rd}	n)d|v r%|j                  d«      |j                  d«      kD  rd}	|	�t        |	«      ‚|S c c}w )z�
        Parse a specific Match config line into a list-of-dicts for its values.

        Performs some parse-time validation as well.
        NF)r‡   rˆ   r¥   r   r   Tr¥   r   r‡   )r‰   rS   rT   z'Missing parameter to Match '{}' keywordrˆ   r‰   )r‰   rS   c                 ó   •— | ‰v S rb   rc   ©re   Ú	allowables    €r   ú<lambda>z(SSHConfig._get_matches.<locals>.<lambda>"  s   ø€  a¨9 n€ r!   c                 ó   •— | ‰vS rb   rc   rÍ   s    €r   rÏ   z(SSHConfig._get_matches.<locals>.<lambda>#  s   ø€  a¨yÐ&8€ r!   z>Match does not allow 'all' mixed with anything but 'canonical'rS   z-Match does not allow 'all' before 'canonical')rÉ   rY   r’   r=   rC   r   r@   rÃ   ÚfilterÚanyÚindex)r   r5   r6   Útokensr¡   re   Úkeywordsr˜   ÚbadÚerrrÎ   s             @r   rE   zSSHConfig._get_matches  sX  ø€ ð ˆÜ—‘˜UÓ#ˆÙØ!¨D¸EÑBˆEØ—J‘J˜q“MˆEà×Ñ Ô$Ø"&��h‘Ø˜a˜b˜	�Ø!ˆE�&‰MàÐ5Ñ5Ø—‘˜uÔ%ØÙÜ&Ø=×DÑDÀUÓKóð ð $ŸZ™Z¨›]ˆE�'‰NØ�N‰N˜5Ô!ò# ð( (/Ö/ !�A�f“IÐ/ˆÐ/Ø�HÑØ,ˆIä”VÓ4°hÓ?Ó@Ü”VÓ8¸(ÓCÓDð ˆBð ˆCÜ�3ŒxØV‘Ø Ñ" r§x¡x°Ó'<¸r¿x¹xÈ»Ò'NØE�ØˆÜ& sÓ+Ð+Øˆùò 0s   Â0D<)NFF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r>   Úcompiler?   r¿   r    Úclassmethodr&   r+   r#   r-   r_   rU   rZ   r|   rh   ri   r“   r”   r©   rl   rD   rE   rc   r!   r   r   r   .   sÇ   „ ñð  �R—Z‘ZÐ ;Ó<€Nò
 HØ�FÚAÚ/Ú'ò Mñ	Ðòð* ñ-ó ð-ð ñ&ó ð&ð ñó ðò:%òx@óD!òF'-òRòò"6òpEò<ò|	6òò*Fó*r!   r   c                 óT  — |j                  dd«      j                  «       }|dk(  ry	 t        j                  }|dk(  rt        j                  }t        j
                  | d|t        j                  t        j                  t        j                  «      S # t        j                  $ r Y yw xY w)a  
    Try looking up ``hostname`` in an IPv4 or IPv6 specific manner.

    This is an odd duck due to needing use in two divergent use cases. It looks
    up ``AddressFamily`` in ``options`` and if it is ``inet`` or ``inet6``,
    this function uses `socket.getaddrinfo` to perform a family-specific
    lookup, returning the result if successful.

    In any other situation -- lookup failure, or ``AddressFamily`` being
    unspecified or ``any`` -- ``None`` is returned instead and the caller is
    expected to do something situation-appropriate like calling
    `socket.gethostbyname`.

    :param str hostname: Hostname to look up.
    :param options: `SSHConfigDict` instance w/ parsed options.
    :returns: ``getaddrinfo``-style tuples, or ``None``, depending.
    ÚaddressfamilyrÒ   NÚinet)
rV   rB   rp   ÚAF_INET6ÚAF_INETÚgetaddrinfoÚ
SOCK_DGRAMÚ
IPPROTO_IPÚAI_CANONNAMErr   )r   r[   Úaddress_familyÚfamilys       r   ro   ro   /  s–   € ð$ —[‘[ °%Ó8×>Ñ>Ó@€NØ˜ÒØðÜ—‘ˆØ˜VÒ#Ü—^‘^ˆFÜ×!Ñ!ØØØÜ×ÑÜ×ÑÜ×Ñó
ð 	
øô �?‰?ò Ùðús   ¨A(B ÂB'Â&B'c                   ó   — e Zd ZdZdd„Zd„ Zy)r¬   z7
    Returns the host's fqdn on request as string.
    Nc                 ó.   — d | _         || _        || _        y rb   )Úfqdnr2   r1   )r   r2   r1   s      r   r    zLazyFqdn.__init__Y  s   € ØˆŒ	ØˆŒØˆ�	r!   c                 óè   — | j                   €[d }t        | j                  | j                  «      }|�|D ]  }|\  }}}}}|sŒd|v sŒ|} n |€t	        j
                  «       }|| _         | j                   S )NrQ   )rë   ro   r1   r2   rp   Úgetfqdn)	r   rë   ÚresultsÚresÚafÚsocktypeÚprotoÚ	canonnameÚsas	            r   Ú__str__zLazyFqdn.__str__^  s‚   € Ø�9‰9Ðð ˆDÜ0°·±¸D¿K¹KÓHˆGØÐ"Ø"ò �CØ9<Ñ6�B˜ %¨°BÚ  S¨IÒ%5Ø(˜Ùð	ð ˆ|Ü—~‘~Ó'�àˆDŒIØ�y‰yÐr!   rb   )rØ   rÙ   rÚ   rÛ   r    rõ   rc   r!   r   r¬   r¬   T  s   „ ñóó
r!   r¬   c                   ó   — e Zd ZdZd„ Zd„ Zy)rg   aÃ  
    A dictionary wrapper/subclass for per-host configuration structures.

    This class introduces some usage niceties for consumers of `SSHConfig`,
    specifically around the issue of variable type conversions: normal value
    access yields strings, but there are now methods such as `as_bool` and
    `as_int` that yield casted values instead.

    For example, given the following ``ssh_config`` file snippet::

        Host foo.example.com
            PasswordAuthentication no
            Compression yes
            ServerAliveInterval 60

    the following code highlights how you can access the raw strings as well as
    usefully Python type-casted versions (recalling that keys are all
    normalized to lowercase first)::

        my_config = SSHConfig()
        my_config.parse(open('~/.ssh/config'))
        conf = my_config.lookup('foo.example.com')

        assert conf['passwordauthentication'] == 'no'
        assert conf.as_bool('passwordauthentication') is False
        assert conf['compression'] == 'yes'
        assert conf.as_bool('compression') is True
        assert conf['serveraliveinterval'] == '60'
        assert conf.as_int('serveraliveinterval') == 60

    .. versionadded:: 2.5
    c                 óV   — | |   }t        |t        «      r|S |j                  «       dk(  S )aº  
        Express given key's value as a boolean type.

        Typically, this is used for ``ssh_config``'s pseudo-boolean values
        which are either ``"yes"`` or ``"no"``. In such cases, ``"yes"`` yields
        ``True`` and any other value becomes ``False``.

        .. note::
            If (for whatever reason) the stored value is already boolean in
            nature, it's simply returned.

        .. versionadded:: 2.5
        rN   )rÂ   ÚboolrB   )r   rJ   Úvals      r   Úas_boolzSSHConfigDict.as_boolœ  s-   € ð �3‰iˆÜ�cœ4Ô ØˆJØ�y‰y‹{˜eÑ#Ð#r!   c                 ó   — t        | |   «      S )zí
        Express given key's value as an integer, if possible.

        This method will raise ``ValueError`` or similar if the value is not
        int-appropriate, same as the builtin `int` type.

        .. versionadded:: 2.5
        )rW   rÀ   s     r   Úas_intzSSHConfigDict.as_int¯  s   € ô �4˜‘9‹~Ðr!   N)rØ   rÙ   rÚ   rÛ   rú   rü   rc   r!   r   rg   rg   z  s   „ ñòB$ó&	r!   rg   )rÛ   r�   r�   r­   r>   rÉ   rp   Úhashlibr   Úior   Ú	functoolsr   r•   r–   ÚImportErrorÚeÚssh_exceptionr   r   rª   r   ro   r¬   Údictrg   rc   r!   r   ú<module>r     sŠ   ðñ(ó Û Û 	Û 	Û Û Ý Ý Ý à(Ñ €ÐðÛ÷ Bð €÷~ñ ~òB"÷J#ñ #ôL>�Dõ >øðk ò ØÕûðús   ³A$ Á$A5Á)A0Á0A5