[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.119.120.222: ~ $


�t�_�-�@s�dZddlZddlmZmZddlmZddlmZ	ddl
mZmZm
Z
mZmZddlmZer�ddlmZmZmZmZmZdd	lmZdd
lmZmZeeeefZeje �Z!yddl"a"WnXe#k
r da"YnAe$k
r`Z%z!e!j&dee%��da"WYddZ%[%XnXdd
�Z'Gdd�de�Z(dS)z�Network Authentication Helpers

Contains interface (MultiDomainBasicAuth) and associated glue code for
providing credentials in the context of network requests.
�N)�AuthBase�
HTTPBasicAuth)�get_netrc_auth)�parse)�ask�	ask_input�ask_password�remove_auth_from_url�split_auth_netloc_from_url)�MYPY_CHECK_RUNNING)�Dict�Optional�Tuple�List�Any)�AuthInfo)�Response�Requestz*Keyring is skipped due to an exception: %scCs�|strdSy�y
tj}Wntk
r6Yn@Xtjd|�|||�}|dk	rr|j|jfSdS|r�tjd|�tj||�}|r�||fSWnAtk
r�}z!tj	dt
|��daWYdd}~XnXdS)z3Return the tuple auth for a given url from keyring.Nz'Getting credentials from keyring for %sz$Getting password from keyring for %sz*Keyring is skipped due to an exception: %s)�keyring�get_credential�AttributeError�logger�debug�username�password�get_password�	Exception�warning�str)�urlrr�credr�exc�r"��/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-1.el7.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/auth.py�get_keyring_auth,s,

r$c@s�eZdZdddd�Zdd�Zdddd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�MultiDomainBasicAuthTNcCs(||_||_i|_d|_dS)N)�	prompting�
index_urls�	passwords�_credentials_to_save)�selfr&r'r"r"r#�__init__Os			zMultiDomainBasicAuth.__init__cCsY|s|jrdSx=|jD]2}t|�jd�d}|j|�r|SqWdS)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�/)r'r	�rstrip�
startswith)r*r�u�prefixr"r"r#�_get_index_url[sz#MultiDomainBasicAuth._get_index_urlcCsUt|�\}}}|\}}|dk	rM|dk	rMtjd|�|S|j|�}	|	r�t|	�}
|
r�|
\}	}}tjd|	�|	r�|ddk	r�|\}}|dk	r�|dk	r�tjd|�|S|r
t|�}
|
r
tjd|�|
S|rKt|	|�p.t||�}|rKtjd|�|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)r
rrr1rr$)r*�original_url�allow_netrc�
allow_keyringr�netloc�url_user_passwordrr�	index_url�
index_info�_�index_url_user_password�
netrc_auth�kr_authr"r"r#�_get_new_credentialsrs:z)MultiDomainBasicAuth._get_new_credentialscCs�t|�\}}}|jj|d�\}}|dkr]|dkr]|j|�\}}|dk	su|dk	r�|p~d}|p�d}||f|j|<|dk	r�|dk	s�|dkr�|dks�tdj|���|||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: {})NN)r
r(�getr=�AssertionError�format)r*r2rr5r9rrr"r"r#�_get_url_and_credentials�sz-MultiDomainBasicAuth._get_url_and_credentialscCsh|j|j�\}}}||_|dk	rQ|dk	rQt||�|�}|jd|j�|S)N�response)rBrr�
register_hook�
handle_401)r*�reqrrrr"r"r#�__call__�s	zMultiDomainBasicAuth.__call__cCs�tdj|��}|sdSt||�}|ri|ddk	ri|ddk	ri|d|ddfStd�}||dfS)Nz
User for {}: Fr�z
Password: T)NNF)rrAr$r)r*r5r�authrr"r"r#�_prompt_for_password�s&z)MultiDomainBasicAuth._prompt_for_passwordcCs#ts
dStdddg�dkS)NFz#Save credentials to keyring [y/N]: �y�n)rr)r*r"r"r#� _should_save_password_to_keyring�sz5MultiDomainBasicAuth._should_save_password_to_keyringc	Ks;|jdkr|S|js |Stj|j�}|j|j�\}}}d|_|dk	r�|dk	r�||f|j|j<|r�|j	�r�|j||f|_|j
|jj�t
|p�d|p�d�|j�}|jd|j�|jr|jd|j�|jj||�}|jj|�|S)Ni�r>rC)�status_coder&�urllib_parse�urlparserrJr5r)r(rM�content�raw�release_connr�requestrD�warn_on_401�save_credentials�
connection�send�history�append)	r*�resp�kwargs�parsedrr�saverF�new_respr"r"r#rE�s(		
$	zMultiDomainBasicAuth.handle_401cKs)|jdkr%tjd|jj�dS)z6Response callback to warn about incorrect credentials.i�z)401 Error, Credentials not correct for %sN)rNrrrTr)r*r[r\r"r"r#rU sz MultiDomainBasicAuth.warn_on_401cKs�tdk	std��ts"dS|j}d|_|r�|jdkr�ytjd�tj|�Wntk
r�tjd�YnXdS)z1Response callback to save credentials on success.Nz'should never reach here without keyringi�zSaving credentials to keyringzFailed to save credentials)	rr@r)rNr�info�set_passwordr�	exception)r*r[r\�credsr"r"r#rV(s		

z%MultiDomainBasicAuth.save_credentials)
�__name__�
__module__�__qualname__r+r1r=rBrGrJrMrErUrVr"r"r"r#r%Ms2).r%))�__doc__�loggingZpip._vendor.requests.authrrZpip._vendor.requests.utilsrZpip._vendor.six.moves.urllibrrO�pip._internal.utils.miscrrrr	r
�pip._internal.utils.typingr�typingrr
rrr� pip._internal.vcs.versioncontrolrZpip._vendor.requests.modelsrrrZCredentials�	getLoggerrdrr�ImportErrorrr!rr$r%r"r"r"r#�<module>s,((

!

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.pyc File 281 B 0644
auth.cpython-35.pyc File 7.54 KB 0644
cache.cpython-35.pyc File 2.79 KB 0644
download.cpython-35.pyc File 4.71 KB 0644
lazy_wheel.cpython-35.pyc File 8.22 KB 0644
session.cpython-35.pyc File 9.85 KB 0644
utils.cpython-35.pyc File 1.5 KB 0644
xmlrpc.cpython-35.pyc File 1.98 KB 0644