403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/pip/_internal/network/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/pip/_internal/network/__pycache__/auth.cpython-39.pyc
a

W��e=P�@szdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZddlm
Z
ddlmZddlmZddlmZmZmZmZmZmZddlmZmZdd	lmZmZdd
lmZddl m!Z!ddl"m#Z#m$Z$m%Z%m&Z&m'Z'dd
l(m)Z)e!e*�Z+da,Gdd�de�Z-Gdd�de
�Z.Gdd�de.�Z/Gdd�de.�Z0Gdd�de.�Z1e
dd�e2e.d�dd��Z3Gdd�de�Z4dS)z�Network Authentication Helpers

Contains interface (MultiDomainBasicAuth) and associated glue code for
providing credentials in the context of network requests.
�N)�ABC�abstractmethod)�	lru_cache)�commonprefix)�Path)�Any�Dict�List�
NamedTuple�Optional�Tuple)�AuthBase�
HTTPBasicAuth)�Request�Response)�get_netrc_auth)�	getLogger)�ask�	ask_input�ask_password�remove_auth_from_url�split_auth_netloc_from_url)�AuthInfoFc@s&eZdZUeed<eed<eed<dS)�Credentials�url�username�passwordN)�__name__�
__module__�__qualname__�str�__annotations__�r"r"�>/usr/lib/python3.9/site-packages/pip/_internal/network/auth.pyr&s
rc@sPeZdZUdZeed<eeeeee	d�dd��Z
eeeedd�dd	��ZdS)
�KeyRingBaseProviderzKeyring base provider interface�has_keyring�rr�returncCsdS�Nr"��selfrrr"r"r#�
get_auth_info1sz!KeyRingBaseProvider.get_auth_infoN�rrrr'cCsdSr(r"�r*rrrr"r"r#�save_auth_info5sz"KeyRingBaseProvider.save_auth_info)rrr�__doc__�boolr!rr rrr+r.r"r"r"r#r$,s
r$c@sBeZdZdZdZeeeeed�dd�Zeeedd�dd	�Z	dS)
�KeyRingNullProviderzKeyring null providerFr&cCsdSr(r"r)r"r"r#r+?sz!KeyRingNullProvider.get_auth_infoNr,cCsdSr(r"r-r"r"r#r.Bsz"KeyRingNullProvider.save_auth_info)
rrrr/r%r rrr+r.r"r"r"r#r1:sr1c@sPeZdZdZdZdd�dd�Zeeeeed�dd	�Z	eeedd
�dd�Z
dS)
�KeyRingPythonProviderz7Keyring interface which uses locally imported `keyring`TN�r'cCsddl}||_dS)Nr��keyring)r*r5r"r"r#�__init__KszKeyRingPythonProvider.__init__r&cCspt|jd�r>t�d|�|j�||�}|dur:|j|jfSdS|durlt�d|�|j�||�}|rl||fSdS)N�get_credentialz'Getting credentials from keyring for %sz$Getting password from keyring for %s)�hasattrr5�logger�debugr7rrZget_password)r*rrZcredrr"r"r#r+Psz#KeyRingPythonProvider.get_auth_infor,cCs|j�|||�dSr()r5Zset_passwordr-r"r"r#r.bsz$KeyRingPythonProvider.save_auth_info)rrrr/r%r6r rrr+r.r"r"r"r#r2Fs
r2c@s|eZdZdZdZedd�dd�Zeeeeed�dd	�Z	eeedd
�dd�Z
eeeed
�dd�Zeeedd�dd�ZdS)�KeyRingCliProviderz�Provider which uses `keyring` cli

    Instead of calling the keyring package installed alongside pip
    we call keyring on the command line which will enable pip to
    use which ever installation of keyring is available first in
    PATH.
    TN)�cmdr'cCs
||_dSr(r4)r*r<r"r"r#r6qszKeyRingCliProvider.__init__r&cCs(|dur$|�||�}|dur$||fSdSr()�
_get_passwordr-r"r"r#r+ts
z KeyRingCliProvider.get_auth_infor,cCs|�|||�Sr()�
_set_passwordr-r"r"r#r.}sz!KeyRingCliProvider.save_auth_info)�service_namerr'cCsb|jdurdS|jd||g}tj��}d|d<tj|tjtj|d�}|jrNdS|j	�
d��tj�S)z;Mirror the implementation of keyring.get_password using cliN�get�utf-8�PYTHONIOENCODING)�stdin�stdout�env)
r5�os�environ�copy�
subprocess�runZDEVNULL�PIPE�
returncoderD�decode�strip�linesep)r*r?rr<rE�resr"r"r#r=�s

�z KeyRingCliProvider._get_password)r?rrr'cCsP|jdurdStj��}d|d<tj|jd||g|�tj���d�|dd�dS)z;Mirror the implementation of keyring.set_password using cliNrArB�setT)�inputrE�check)r5rFrGrHrIrJrO�encode)r*r?rrrEr"r"r#r>�s

�z KeyRingCliProvider._set_password)
rrrr/r%r r6rrr+r.r=r>r"r"r"r#r;fs	r;)�maxsize��providerr'c

Csvt�d|�trd}|dvr�zt�}t�d�|WStyDYnPty�}z8d}|dkrf|d}tj||t�tj	�d�WYd}~n
d}~00|d	v�rft
�d
�}|�rL|�t
�d���rLtjtd�d
d��}tt
�d��}g}|��tj�D]<}t|�}	z|	�|��s|�|�Wq�t�y.Yq�0q�tj�|�}t
jd
|d�}|�rft�d|�t|�St�d�t�S)NzKeyring provider requested: %s�disabled)�import�autozKeyring provider set: importz1Installed copy of keyring fails with exception %srZz3, trying to find a keyring executable as a fallback)�exc_info)rIrZr5�scriptsr3c	SsFtj�dd�}|durBzt�d�}Wnttfy@tj}Yn0|S)N�PATH�CS_PATH)rFrGr@�confstr�AttributeError�
ValueError�defpath��pathr"r"r#�"PATH_as_shutil_which_determines_it�sz@get_keyring_provider.<locals>.PATH_as_shutil_which_determines_itrcz3Keyring provider set: subprocess with executable %szKeyring provider set: disabled)r9�verbose�KEYRING_DISABLEDr2�ImportError�	Exception�warningZisEnabledFor�logging�DEBUG�shutil�which�
startswith�	sysconfigZget_path�typing�
no_type_checkr r�splitrF�pathsep�samefile�append�FileNotFoundError�joinr;r1)
rW�impl�exc�msgZclirer\�pathsrd�pr"r"r#�get_keyring_provider�sH
.



r~c@sJeZdZd+eeeeedd�dd�Zee	d�dd	��Z
e
jedd
�dd	��Z
eed�dd
��Zeeeeee
d�dd�Zeeed�dd�Zddd�eeee
d�dd�Zeeeeeeefd�dd�Zeed�dd�Zeeeeeeefd�d d!�Zed�d"d#�Zeeed$�d%d&�Zeedd$�d'd(�Zeedd$�d)d*�ZdS),�MultiDomainBasicAuthTNrZ)�	prompting�
index_urls�keyring_providerr'cCs"||_||_||_i|_d|_dSr()r�r�r��	passwords�_credentials_to_save)r*r�r�r�r"r"r#r6�s
zMultiDomainBasicAuth.__init__r3cCs
t|j�Sr()r~�_keyring_provider�r*r"r"r#r��sz%MultiDomainBasicAuth.keyring_providerrVcCs
||_dSr()r�)r*rWr"r"r#r��scCs|jp|jdvS)N)rZrX)r�r�r�r"r"r#�use_keyring�sz MultiDomainBasicAuth.use_keyringr&c
Cs`|sdSz|j�||�WStyZ}z*t�dt|��dat��WYd}~dSd}~00dS)z3Return the tuple auth for a given url from keyring.Nz*Keyring is skipped due to an exception: %sT)	r�r+rir9rjr rgr~�cache_clear)r*rrrzr"r"r#�_get_keyring_auths�z&MultiDomainBasicAuth._get_keyring_auth)rr'cs�|r
|jsdSt|��d�d}tj�|��g}|jD]V}|�d�d}tj�t|��}�|krh|S�j|jkrvq6tj�|�}|�|�q6|s�dS|jd�fdd�d�tj�	|d�S)a�Return the original index URL matching the requested URL.

        Cached or dynamically generated credentials may work against
        the original index URL rather than just the netloc.

        The provided url should have had its username and password
        removed already. If the original index url had credentials then
        they will be included in the return value.

        Returns None if no matching index was found, or if --no-index
        was specified by the user.
        N�/Tcst�j|jg��d�S)Nr�)rrd�rfind)�	candidate�Z
parsed_urlr"r#�<lambda>@s���z5MultiDomainBasicAuth._get_index_url.<locals>.<lambda>)�reverse�keyr)
r�r�rstrip�urllib�parse�urlsplit�netlocrv�sort�
urlunsplit)r*rZ
candidates�indexZparsed_indexr�r"r�r#�_get_index_urls*


�
z#MultiDomainBasicAuth._get_index_urlF��allow_netrc�
allow_keyring)�original_urlr�r�r'cCs�t|�\}}}|\}}|dur6|dur6t�d|�|S|�|�}	|	rft|	�}
|
rf|
\}	}}t�d|	�|	r�|ddur�|\}}|dur�|dur�t�d|�|S|r�t|�}
|
r�t�d|�|
S|r�|�|	|�p�|�||�}|r�t�d|�|S||fS)z2Find and return credentials for the specified URL.NzFound credentials in url for %szFound index url %srz%Found credentials in index url for %sz!Found credentials in netrc for %sz#Found credentials in keyring for %s)rr9r:r�rr�)r*r�r�r�rr�Zurl_user_passwordrrZ	index_urlZ
index_info�_Zindex_url_user_passwordZ
netrc_authZkr_authr"r"r#�_get_new_credentialsJs>	�



�z)MultiDomainBasicAuth._get_new_credentials)r�r'c	Cs�t|�\}}}|�|�\}}|dus,|dur^||jvr^|j|\}}|dusT||kr^||}}|dusn|dur�|ptd}|p|d}||f|j|<|dur�|dus�|dur�|dus�Jd|����|||fS)a_Return the credentials to use for the provided URL.

        If allowed, netrc and keyring may be used to obtain the
        correct credentials.

        Returns (url_without_credentials, username, password). Note
        that even if the original URL contains credentials, this
        function may return a different username and password.
        N�z%Could not load credentials from url: )rr�r�)	r*r�rr�r�rrZunZpwr"r"r#�_get_url_and_credentials�s*
�����z-MultiDomainBasicAuth._get_url_and_credentials)�reqr'cCsH|�|j�\}}}||_|dur6|dur6t||�|�}|�d|j�|S)N�response)r�rr�
register_hook�
handle_401)r*r�rrrr"r"r#�__call__�szMultiDomainBasicAuth.__call__)r�r'cCst|jrtd|�d��nd}|s"dS|jrb|�||�}|rb|ddurb|ddurb|d|ddfStd�}||dfS)	Nz	User for z: )NNFr�Fz
Password: T)r�rr�r�r)r*r�rZauthrr"r"r#�_prompt_for_password�sz)MultiDomainBasicAuth._prompt_for_passwordcCs*|jr|jr|jjsdStdddg�dkS)NFz#Save credentials to keyring [y/N]: �y�n)r�r�r�r%rr�r"r"r#� _should_save_password_to_keyring�s���z5MultiDomainBasicAuth._should_save_password_to_keyring)�resp�kwargsr'c
Ks"|jdkr|Sd\}}|jr2|j|jddd�\}}|jsD|sD|sD|Stj�|j�}d}|sp|sp|�|j	�\}}}d|_
|dur�|dur�||f|j|j	<|r�|��r�t
|j	||d�|_
|j}|j��t|p�d|p�d�|j�}|�d|j�|j
r�|�d|j�|jj|fi|��}	|	j�|�|	S)	N�)NNFTr�)rrrr�r�)�status_coder�r�rr�r�r��urlparser�r�r�r�r�rZcontent�rawZrelease_connr�requestr��warn_on_401�save_credentialsZ
connection�send�historyrv)
r*r�r�rr�parsedZsaver�r�Znew_respr"r"r#r��sB
�
�

zMultiDomainBasicAuth.handle_401cKs|jdkrt�d|jj�dS)z6Response callback to warn about incorrect credentials.r�z)401 Error, Credentials not correct for %sN)r�r9rjr�r)r*r�r�r"r"r#r�s

�z MultiDomainBasicAuth.warn_on_401cKsp|jjsJd��|j}d|_|rl|jdkrlz$t�d�|j�|j|j|j	�Wnt
yjt�d�Yn0dS)z1Response callback to save credentials on success.z'should never reach here without keyringNi�zSaving credentials to keyringzFailed to save credentials)r�r%r�r�r9�infor.rrrri�	exception)r*r�r�Zcredsr"r"r#r�"s��
�z%MultiDomainBasicAuth.save_credentials)TNrZ)rrrr0rr	r r6�propertyr$r��setterr�rr�r�r�rr�rr�r�r�rrr�r�r�r"r"r"r#r�sN�
��4��:�0�	?r)5r/rkrFrmrIrprq�urllib.parser��abcrr�	functoolsrZos.pathr�pathlibrrrr	r
rrZpip._vendor.requests.authr
rZpip._vendor.requests.modelsrrZpip._vendor.requests.utilsrZpip._internal.utils.loggingrZpip._internal.utils.miscrrrrrZ pip._internal.vcs.versioncontrolrrr9rgrr$r1r2r;r r~rr"r"r"r#�<module>s8  ;=

Youez - 2016 - github.com/yon3zu
LinuXploit