%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/
Upload File :
Create Path :
Current File : //opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyc

�
�wMVc@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
dZd	Zd
�Zdefd��YZd
efd��YZdefd��YZdefd��YZdS(s]
requests.auth
~~~~~~~~~~~~~

This module contains the authentication handlers for Requests.
i����N(t	b64encodei(turlparsetstr(textract_cookies_to_jar(tparse_dict_headers!application/x-www-form-urlencodedsmultipart/form-datacCs0dtd||fjd��j�jd�S(sReturns a Basic Auth string.sBasic s%s:%stlatin1(Rtencodetstriptdecode(tusernametpassword((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyt_basic_auth_strstAuthBasecBseZdZd�ZRS(s4Base class that all auth implementations derive fromcCstd��dS(NsAuth hooks must be callable.(tNotImplementedError(tselftr((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyt__call__"s(t__name__t
__module__t__doc__R(((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyRst
HTTPBasicAuthcBs eZdZd�Zd�ZRS(s?Attaches HTTP Basic Authentication to the given Request object.cCs||_||_dS(N(R	R
(RR	R
((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyt__init__(s	cCs t|j|j�|jd<|S(Nt
Authorization(RR	R
theaders(RR((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyR,s(RRRRR(((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyR&s	t
HTTPProxyAuthcBseZdZd�ZRS(s=Attaches HTTP Proxy Authentication to a given Request object.cCs t|j|j�|jd<|S(NsProxy-Authorization(RR	R
R(RR((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyR3s(RRRR(((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyR1stHTTPDigestAuthcBs2eZdZd�Zd�Zd�Zd�ZRS(s@Attaches HTTP Digest Authentication to the given Request object.cCs:||_||_d|_d|_i|_d|_dS(Nti(R	R
t
last_noncetnonce_counttchaltNonetpos(RR	R
((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyR:s					cs'|jd}|jd}|jjd�}|jjd�}|jjd�}|dkred}n|j�}|dks�|dkr�d�}	|	�n|d	kr�d
�}
|
�n�fd�}�dkr�dSd}t|�}
|
j}|
jr|d|
j7}nd
|j||jf}d||f}�|�}�|�}||j	krr|j
d7_
n	d|_
d|j
}t|j
�jd�}||jd�7}|t
j�jd�7}|tjd�7}tj|�j�d }d|||||f}|dkr9�d
|||f�}n|dkra||d||f�}n7|dks�d|jd�kr�|||�}ndS||_	d|j||||f}|r�|d|7}n|r�|d|7}n|r|d|7}n|r|d||f7}nd|S(Ntrealmtnoncetqopt	algorithmtopaquetMD5sMD5-SESScSs4t|t�r!|jd�}ntj|�j�S(Nsutf-8(t
isinstanceRRthashlibtmd5t	hexdigest(tx((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pytmd5_utf8PstSHAcSs4t|t�r!|jd�}ntj|�j�S(Nsutf-8(R&RRR'tsha1R)(R*((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pytsha_utf8Vscs�d||f�S(Ns%s:%s((tstd(t	hash_utf8(sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyt<lambda>\st?s%s:%s:%ss%s:%sis%08xsutf-8iis%s:%s:%s:%s:%stautht,s>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"s
, opaque="%s"s, algorithm="%s"s
, digest="%s"s , qop="auth", nc=%s, cnonce="%s"s	Digest %s(RtgetRtupperRtpathtqueryR	R
RRRRttimetctimetosturandomR'R-R)tsplit(RtmethodturlR R!R"R#R$t
_algorithmR+R.tKDtentdigtp_parsedR8tA1tA2tHA1tHA2tncvalueR/tcnoncetnoncebittrespdigtbase((R1sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pytbuild_digest_headerBsn

								
!	cKsk|jdk	r(|jjj|j�nt|dd�}|jjdd�}d|j�krW|dkrWt	|d|d�t
jddt
j�}t
|jd|d	d��|_|j|jj�|jj�}t|j|j|j�|j|j�|j|j|j�|jd
<|jj||�}|jj|�||_|St	|dd�|S(s:Takes the given response and tries digest-auth, if needed.t
num_401_callsiswww-authenticateRtdigestisdigest tflagstcountRN(RRtrequesttbodytseektgetattrRR6tlowertsetattrtretcompilet
IGNORECASERtsubRtcontenttrawtrelease_conntcopyRt_cookiestprepare_cookiesRNR?R@t
connectiontsendthistorytappend(RRtkwargsROts_authtpattprept_r((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyt
handle_401�s*!
	cCsl|jr+|j|j|j�|jd<ny|jj�|_Wntk
rTnX|j	d|j
�|S(NRtresponse(RRNR?R@RRTttellRtAttributeErrort
register_hookRl(RR((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyR�s	"
(RRRRRNRlR(((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyR8s
		S	#(RR<RYR:R'tbase64RtcompatRRtcookiesRtutilsRtCONTENT_TYPE_FORM_URLENCODEDtCONTENT_TYPE_MULTI_PARTRtobjectRRRR(((sJ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/requests/auth.pyt<module>s	

Zerion Mini Shell 1.0