HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/site-packages/pip/_internal/network/__pycache__/session.cpython-310.pyc
o

��iH�@stUdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlmZmZmZmZmZmZmZmZmZmZddlmZmZddlmZ ddl!m"Z"m#Z#ddl!m$Z%ddl&m'Z'm(Z(dd	l)m*Z*dd
l+m,Z,ddl-m.Z.ddl/m0Z0dd
l1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl;m<Z<ddl=m>Z>m?Z?ddl@mAZAer�ddlBmCZCddlDmEZEe�FeG�ZHeeIeIeeeJeIffZKejLde.d�gd�ZMeeKeNd<dZOdePfdd�ZQdeIfdd �ZRGd!d"�d"e#�ZSGd#d$�d$�ZTGd%d&�d&eTe%�Z$Gd'd(�d(eTe �ZGd)d*�d*e$�ZUGd+d,�d,e�ZVGd-d.�d.ejW�ZXdS)/zhPipSession and supporting code, containing all pip-specific
network request configuration and behavior.
�N)
�
TYPE_CHECKING�Any�Dict�	Generator�List�Mapping�Optional�Sequence�Tuple�Union)�requests�urllib3)�CacheControlAdapter)�DEFAULT_POOLBLOCK�BaseAdapter)�HTTPAdapter)�PreparedRequest�Response)�CaseInsensitiveDict)�ConnectionPool)�InsecureRequestWarning)�__version__)�get_default_environment)�Link)�MultiDomainBasicAuth)�
SafeFileCache)�has_tls)�libc_ver)�build_url_from_netloc�parse_netloc)�url_to_path)�
SSLContext)�PoolManager�ignore)�category))�https�*r&)r&�	localhostr&)r&z127.0.0.0/8r&)r&z::1/128r&)�filer&N)�sshr&r&�SECURE_ORIGINS)�
BUILD_BUILDID�BUILD_ID�CI�	PIP_IS_CI�returncCstdd�tD��S)z?
    Return whether it looks like pip is running under CI.
    css�|]}|tjvVqdS�N)�os�environ)�.0�name�r5�H/usr/local/lib/python3.10/site-packages/pip/_internal/network/session.py�	<genexpr>js�z looks_like_ci.<locals>.<genexpr>)�any�CI_ENVIRONMENT_VARIABLESr5r5r5r6�
looks_like_cicsr:c
Cs�dtd�t��dt��id�}|dddkr t��|dd<nF|dddkrEtj}|jd	kr6|d
d�}d�d
d�|D��|dd<n!|dddkrVt��|dd<n|dddkrft��|dd<tj�d�r�ddl	m
}|��|��|�
�f}ttdd�tgd�|���}ttdd�tddgt����}|r�||d<|r�||d<tj�d�r�t��dr�dt��dd�|d<t��r�t��|�di�d<t��r�t��|�di�d<t��r�t��|d<t�r�dd
l}|j|d <t��d!�}|d
u�rt|j�|d"<t�d#�d
u�r2z
tj d#d$gtj!d%d&�}Wn
t"�y Ynw|�d'��r2|�#d(�d)�$�|d*<t%��r8d+nd
|d,<t&j'�(d-�}	|	d
u�rK|	|d.<d/j)|t*j+|d0d+d1�d2�S)3z6
    Return a string representing the user agent.
    �pip)r4�versionr4)�	installer�python�implementationr?�CPythonr<�PyPy�finalN��.cSsg|]}t|��qSr5)�str)r3�xr5r5r6�
<listcomp>�szuser_agent.<locals>.<listcomp>�Jython�
IronPython�linuxr)�distrocS�|dS�N�r5�rFr5r5r6�<lambda>��zuser_agent.<locals>.<lambda>)r4r<�idcSrLrMr5rOr5r5r6rP�rQ�lib�libcrK�darwin�macOS�system�release�cpu�openssl_version�
setuptools�setuptools_version�rustcz	--versiong�?)�stderr�timeoutsrustc � rN�
rustc_versionT�ci�PIP_USER_AGENT_USER_DATA�	user_dataz9{data[installer][name]}/{data[installer][version]} {json})�,�:)�
separators�	sort_keys)�data�json),r�platform�python_version�python_implementation�sys�pypy_version_info�releaselevel�join�
startswith�pip._vendorrKr4r<�codename�dict�filter�zipr�mac_verrW�
setdefaultrX�machiner�_ssl�OPENSSL_VERSIONr�get_distributionrE�shutil�which�
subprocess�check_output�STDOUT�	Exception�split�decoder:r1r2�get�formatrj�dumps)
rirorK�linux_distribution�distro_infosrT�ssl�setuptools_dist�rustc_outputrdr5r5r6�
user_agentms���
�����


��
�r�c@s�eZdZ					ddededeeeeeeffdeee	fdeee	ee	e	ffd	ee
e	e	fd
efdd�Zdd
d�Z
dS)�LocalFSAdapterFNT�request�streamr_�verify�cert�proxiesr/c

Cs�t|j�}t�}d|_|j|_zt�|�}	Wn+tyA}
zd|_t|
�j|_	t
�|j	�d|
���d��|_
WYd}
~
|Sd}
~
wwtjj|	jdd�}t�|�dpSd}t||	j|d	��|_t|d
�|_
|j
j|_|S)N��i�z: �utf8T)�usegmtrz
text/plain)zContent-TypezContent-Lengthz
Last-Modified�rb)r �urlr�status_coder1�stat�OSError�type�__name__�reason�io�BytesIO�encode�raw�email�utils�
formatdate�st_mtime�	mimetypes�
guess_typer�st_size�headers�open�close)
�selfr�r�r_r�r�r��pathname�resp�stats�exc�modified�content_typer5r5r6�send�s0
	(����
zLocalFSAdapter.sendcCsdSr0r5)r�r5r5r6r��szLocalFSAdapter.close)FNTNN)r/N)r��
__module__�__qualname__r�boolrr�floatr
rErrr�r�r5r5r5r6r��s,����
���
�'r�cs^eZdZdZdd�deddeddf�fdd	�Zefd
edede	d
eddf
�fdd�
Z
�ZS)�_SSLContextAdapterMixina#Mixin to add the ``ssl_context`` constructor argument to HTTP adapters.

    The additional argument is forwarded directly to the pool manager. This allows us
    to dynamically decide what SSL store to use at runtime, which is used to implement
    the optional ``truststore`` backend.
    N)�ssl_contextr�r!�kwargsr/cs||_t�jdi|��dS)Nr5)�_ssl_context�super�__init__)r�r�r���	__class__r5r6r�sz _SSLContextAdapterMixin.__init__�connections�maxsize�block�pool_kwargsr"cs2|jdur|�d|j�t�jd|||d�|��S)Nr�)r�r�r�r5)r�ryr��init_poolmanager)r�r�r�r�r�r�r5r6r�s
��z(_SSLContextAdapterMixin.init_poolmanager)r�r�r��__doc__rrr�r�intr�r��
__classcell__r5r5r�r6r��s,
����
������r�c@�eZdZdS)rN�r�r�r�r5r5r5r6r �rc@r�)rNr�r5r5r5r6r$r�rc
�NeZdZdededeeefdeeeeeeffddf
�fdd�Z	�Z
S)	�InsecureHTTPAdapter�connr�r�r�r/Nc�t�j||d|d�dS�NF)r�r�r�r��r��cert_verify�r�r�r�r�r�r�r5r6r�)�zInsecureHTTPAdapter.cert_verify�r�r�r�rrErr�rr
r�r�r5r5r�r6r�(���
���r�c
r�)	�InsecureCacheControlAdapterr�r�r�r�r/Ncr�r�r�r�r�r5r6r�4r�z'InsecureCacheControlAdapter.cert_verifyr�r5r5r�r6r�3r�r�cs�eZdZUdZeeed<dddddd�dededeed	e	ed
ee
ededd
eddf�fdd�Zde
eddfdd�Z	d#dedeede
ddfdd�Zdeeddffdd�Zdede
fdd�Zded eded
edef
�fd!d"�Z�ZS)$�
PipSessionNr_rr5)�retries�cache�
trusted_hosts�
index_urlsr��argsr�r�r�r�r�r!r�r/cs�t�j|i|��g|_t�|jd<t|d�|_tj|gd�dd�}t	|d�}|r<t
t|�||d�}	tt|�|d�|_
n	t||d	�}	||_
|�d
|	�|�d|�|�dt��|D]	}
|j|
d
d�qZdS)zj
        :param trusted_hosts: Domains not to emit warnings for when not using
            HTTPS.
        z
User-Agent)r�)i�i�iig�?)�total�status_forcelist�backoff_factor)�max_retries)r�r�r�)r�r�)r�r�zhttps://zhttp://zfile://T)�suppress_loggingN)r�r��pip_trusted_originsr�r�r�authr
�Retryr�rrr��_trusted_host_adapterr�mountr��add_trusted_host)r�r�r�r�r�r�r�r��insecure_adapter�secure_adapter�hostr�r5r6r�Bs8�
�
��zPipSession.__init__�new_index_urlscCs||j_dS)zn
        :param new_index_urls: New index urls to update the authentication
            handler with.
        N)r�r�)r�r�r5r5r6�update_index_urls�szPipSession.update_index_urlsFr��sourcer�cCs�|sd|��}|dur|d|�d�7}t�|�t|�}||jvr'|j�|�|�t|dd�d|j�|�t|�d|j�|ds]|�t|dd�d	|j�|�t|�d	|j�dSdS)
z�
        :param host: It is okay to provide a host that has previously been
            added.
        :param source: An optional source string, for logging where the host
            string came from.
        zadding trusted host: Nz (from �)�http)�scheme�/rNrf)�logger�inforr��appendr�rr�)r�r�r�r��msg�	host_portr5r5r6r��s&	


���zPipSession.add_trusted_hostccs8�tEdH|jD]\}}d||durdn|fVq	dS)Nr&)r*r�)r�r��portr5r5r6�iter_secure_origins�s
�
�zPipSession.iter_secure_origins�locationc	Cs�tj�t|��}|j|j|j}}}|�dd�d}|��D]L}|\}}}	||kr/|dkr/qzt	�
|p5d�}
t	�|�}WntyV|rT|�
�|�
�krT|dkrTYqYnw|
|vr\q||	kri|	dkri|	duriqdSt�d||�dS)	N�+rN���r&�Tz�The repository located at %s is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host %s'.F)�urllib�parse�urlparserEr��hostnamer��rsplitr��	ipaddress�
ip_address�
ip_network�
ValueError�lowerr��warning)r�r��parsed�origin_protocol�origin_host�origin_port�
secure_origin�secure_protocol�secure_host�secure_port�addr�networkr5r5r6�is_secure_origin�sD
�

����	zPipSession.is_secure_origin�methodr�cs8|�d|j�|�d|j�t�j||g|�Ri|��S)Nr_r�)ryr_r�r�r�)r�rr�r�r�r�r5r6r��szPipSession.request)NF)r�r�r�r_rr��__annotations__rrEr	rr�r�r�r�r�SecureOriginr�rrrr�r�r5r5r�r6r�>sL
�����
���	�O����
�*Cr�)Yr��email.utilsr�r�rrj�loggingr�r1rkr~r�rn�urllib.parser��warnings�typingrrrrrrrr	r
rrsrr
�pip._vendor.cachecontrolr�_BaseCacheControlAdapterZpip._vendor.requests.adaptersrrr�_BaseHTTPAdapterZpip._vendor.requests.modelsrrZpip._vendor.requests.structuresrZ"pip._vendor.urllib3.connectionpoolrZpip._vendor.urllib3.exceptionsrr;r�pip._internal.metadatar�pip._internal.models.linkr�pip._internal.network.authr�pip._internal.network.cacher�pip._internal.utils.compatr�pip._internal.utils.glibcr�pip._internal.utils.miscrr�pip._internal.utils.urlsr r�r!Zpip._vendor.urllib3.poolmanagerr"�	getLoggerr�r�rEr�r�filterwarningsr*rr9r�r:r�r�r�r�r��Sessionr�r5r5r5r6�<module>sb0


e,"