7f5IRUdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZmZmZmZmZmZmZmZmZmZddlmZmZddlm Z!ddl"m#Z#m$Z$ddl"m%Z&ddl'm(Z(m)Z)dd l*m+Z+dd l,m-Z-dd l.m/Z/dd l0m1Z1dd l2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9ddl:m;Z;ddlm?Z?m@Z@ddlAmBZBer ddlCmDZDddlEmFZFejGeHZIeeJeJeeeKeJffZLejMde/gdZNeeLeOd<dZPdeQfdZRejSddeJfd ZTGd!d"e$ZUGd#d$ZVGd%d&eVe&Z%Gd'd(eVe!Z Gd)d*e%ZWGd+d,e ZXGd-d.ejYZZdS)/zhPipSession and supporting code, containing all pip-specific network request configuration and behavior. N) TYPE_CHECKINGAnyDict GeneratorListMappingOptionalSequenceTupleUnion)requestsurllib3)CacheControlAdapter)DEFAULT_POOLBLOCK BaseAdapter) HTTPAdapter)PreparedRequestResponse)CaseInsensitiveDict)ConnectionPool)InsecureRequestWarning) __version__)get_default_environment)Link)MultiDomainBasicAuth) SafeFileCache)has_tls)libc_ver)build_url_from_netloc parse_netloc) url_to_path) SSLContext) PoolManagerignore)category))https*r')r' localhostr')r'z 127.0.0.0/8r')r'z::1/128r')filer'N)sshr'r'SECURE_ORIGINS) BUILD_BUILDIDBUILD_IDCI PIP_IS_CIreturnc>tdtDS)z? Return whether it looks like pip is running under CI. c32K|]}|tjvVdSN)osenviron).0names }/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/network/session.py z looks_like_ci..ks)GGdtrz!GGGGGG)anyCI_ENVIRONMENT_VARIABLESr:r8 looks_like_cir>ds" GG.FGGG G GGr:)maxsizec ldtdtjdtjid}|dddkrtj|dd<n|dddkrJtj}|jd kr |d d }d d |D|dd<n]|dddkrtj|dd<n.|dddkrtj|dd<tjdrddl m }| | | f}ttdt!gd|}ttdt!ddgt#}|r||d<|r||d<tjdr8tjdrdtjdd|d<tjr*tj|did<tjr*tj|did<tjrtj|d<t/rdd l}|j|d<t5d}|t9|j |d <t;jd!z t?j d!d"gt>j!d#$}|d%r0|"d&d'#|d(<n#tH$rYnwxYwtKrd)nd |d*<tLj'(d+} | | |d,<d-)|tUj+|d.d)/0S)1z6 Return a string representing the user agent. pip)r7versionr7) installerpythonimplementationrFCPythonrCPyPyfinalN.c,g|]}t|Sr=)str)r6xs r8 zuser_agent..s / / /SVV / / /r:Jython IronPythonlinuxr)distroc|dSNr?r=rNs r8zuser_agent.. !A$r:)r7rCidc|dSrUr=rVs r8rWzuser_agent..rXr:liblibcrSdarwinmacOSsystemreleasecpuopenssl_version setuptoolssetuptools_versionrustcz --versiong?)stderrtimeoutsrustc  r? rustc_versionTciPIP_USER_AGENT_USER_DATA user_dataz9{data[installer][name]}/{data[installer][version]} {json}),:) separators sort_keys)datajson),rplatformpython_versionpython_implementationsyspypy_version_info releaseleveljoin startswith pip._vendorrSr7rCcodenamedictfilterziprmac_verr_ setdefaultr`machiner_sslOPENSSL_VERSIONrget_distributionrMshutilwhich subprocess check_outputSTDOUTsplitdecode Exceptionr>r4r5getformatrrdumps) rqrwrSlinux_distribution distro_infosr\sslsetuptools_dist rustc_outputrls r8 user_agentrnsk $ <<)++ H244 D f%22,4,C,E,E y))   '6 1 11  )W 4 4 1"1" 5 ,/HH / /. / / /- -  y))   '8 3 3,4,C,E,E y))   '< 7 7,4,C,E,E y) |w''*&&&&&&#[[]]FNN,<,O>OO'+ ---/ABB  ( (  UI& 33      (#'L  *)DN |x((MX-=-?-?-BM")h6F6H6H6KLLXB080A0A"%%f-F3;3C3E3E"%%i0)&((U yy6"%"5 -//@@NNO"%()@%A%A !" |G( M%2+&z/@#L &&y11 M)5(:(:4(@(@(C(J(J(L(L_%    D '2dDJ 9::I%[ F M M  Zt D D D N  s#N?? O  O ceZdZ d dededeeeeeeffdeee fdeee ee e ffd ee e e fd e fd Z dd Z dS)LocalFSAdapterFNTrequeststreamrgverifycertproxiesr0c~t|j}t}d|_|j|_ t j|} t j| j d} tj |dpd} t| | j | d|_t|d|_|jj|_nl#t$$r_} d|_t'| j|_t-j|jd | |_Yd} ~ nd} ~ wwxYw|S) NT)usegmtrz text/plain)z Content-TypezContent-Lengthz Last-Modifiedrbiz: )r!urlr status_coder4statemailutils formatdatest_mtime mimetypes guess_typerst_sizeheadersopenrawcloseOSErrortype__name__reasonioBytesIOencode) selfrrrgrrrpathnamerespstatsmodified content_typeexcs r8sendzLocalFSAdapter.sends<w{++zz; (GH%%E{--enT-JJH$/99!<L L.$0&+m%-DLHd++DHDJJ% D D D #D s)),DKzT["9"9C"9"9"@"@"B"BCCDHHHHHH  D( sC D:AD55D:cdSr3r=)rs r8rzLocalFSAdapter.closes r:)FNTNN)r0N)r __module__ __qualname__rboolr r floatr rMrrrrr=r:r8rrs?C#'6:/3%% %%%uUE\': :;< % dCi % uS%S/123 %'#s(+,% %%%%N      r:rc feZdZdZdddeddeddffdZefd ed ed e d edd f fd Z xZ S)_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_contextrr"kwargsr0c H||_tjdi|dS)Nr=) _ssl_contextsuper__init__)rrr __class__s r8rz _SSLContextAdapterMixin.__init__s0 (""6"""""r: connectionsr@block pool_kwargsr#c |j|d|jtjd|||d|S)Nr)rr@rr=)rrrinit_poolmanager)rrr@rrrs r8rz(_SSLContextAdapterMixin.init_poolmanagers_   (  " "=$2C D D D'uww' #      r:) rrr__doc__r rrrintrr __classcell__rs@r8rrs/3###l+# #  ######(                    r:rceZdZdS)rNrrrr=r:r8rr"Dr:rceZdZdS)rNrr=r:r8rr&rr:rc peZdZdededeeefdeeeeeeffddf fd Z xZ S)InsecureHTTPAdapterconnrrrr0NcRt||d|dSNF)rrrrr cert_verifyrrrrrrs r8rzInsecureHTTPAdapter.cert_verify+, 3u4HHHHHr: rrrrrMr rr r rrrs@r8rr*IIIdCi I uS%S/123 I  IIIIIIIIIIr:rc peZdZdededeeefdeeeeeeffddf fd Z xZ S)InsecureCacheControlAdapterrrrrr0NcRt||d|dSrrrs r8rz'InsecureCacheControlAdapter.cert_verify6rr:rrs@r8rr5rr:rc8eZdZUdZeeed<dddddddededeed e ed ee ed ed d eddffdZ de eddfdZ ddedeede ddfdZdeeddffdZdede fdZdededed edef fd ZxZS) PipSessionNrgrr=)retriescache trusted_hosts index_urlsrargsrrrrrr"rr0c~tj|i|g|_t|jd<t ||_tj|gdd}t|}|rCtt|||} tt|||_ nt|| } ||_ |d | |d ||d t!|D]} || d dS)zj :param trusted_hosts: Domains not to emit warnings for when not using HTTPS. z User-Agent)r)iiiiig?)totalstatus_forcelistbackoff_factor) max_retries)rrr)rr)rrzhttps://zhttp://zfile://T)suppress_loggingN)rrpip_trusted_originsrrrauthrRetryrrrr_trusted_host_adapterrmountradd_trusted_host) rrrrrrrrinsecure_adaptersecure_adapterhostrs r8rzPipSession.__init__Cs $)&)))EG &0\\ \")J??? -766    ,/7CCC  :0#E**#'N *E#E**#***D & & )W+VVVN)9D & :~... 9./// 9n..///! ? ?D  ! !$ ! > > > > ? ?r:new_index_urlsc||j_dS)zn :param new_index_urls: New index urls to update the authentication handler with. N)rr)rrs r8update_index_urlszPipSession.update_index_urlss . r:Frsourcerc`|s*d|}| |d|dz }t|t|\}}|td|||f|jvr|j||f|t|ddz|j|t|dz|j|sZ|t|dd z|j|t|d z|jdSdS) 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 )z+Trusted host URL must include a host part: http)scheme/rn) loggerinfor ValueErrorrappendrrr)rrrrmsg parsed_host parsed_ports r8rzPipSession.add_trusted_hostso  2$22C!***** KK   #/#5#5 [  S4SSTT T  %T-E E E  $ + +[+,F G G G !$v 6 6 6 X    (..4d6PQQQ V JJ%d6:::S@*    JJ,T22S8$:T U U U U U  V Vr:c#TKtEd{V|jD]\}}d||dn|fVdS)Nr')r+r)rrports r8iter_secure_originszPipSession.iter_secure_originss\!!!!!!!!2 = =JD$T\cct< < < < < = =r:locationcXtjt|}|j|j|j}}}|ddd}|D]}|\}}} ||kr|dkr tj |pd} tj |} | | vrEnD#t$r7|r2| | kr|dkrYYnwxYw|| kr | dkr| dStd||dS) N+r?r'TzThe 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)urllibparseurlparserMrhostnamerrsplitr ipaddress ip_address ip_networkr lowerrwarning) rrparsedorigin_protocol origin_host origin_port secure_originsecure_protocol secure_host secure_portaddrnetworks r8is_secure_originzPipSession.is_secure_origins&&s8}}55 M O K'2*00a88< "5577! ! M8E 5O[+/11o6L6L  +K,=2>>#.{;;w&&'    #))++{/@/@/B/BBB#s**H "{**3&&+44  I      us*B88 lru_cacherrrrrSessionrr=r:r8rJs                             *)))))))TTTTTTHHHHHHHHIIIIIIAAAAAAAA??????======AAAAAA::::::******;;;;;;555555/...........HHHHHHHH000000<;;;;;;  8 $ $S#xc3h889 +ABBBB & & &\"   ( HtHHHHQbCbbb bJ) ) ) ) ) [) ) ) X        D     )+;        13K   IIIII+IIIIIIII"5IIIJ=J=J=J=J=!J=J=J=J=J=r: