/opt/alt/python27/lib/python2.7/site-packages/requests
NameSizeModeActions
packages/-0755rm
adapters.py186800644editdlrm
adapters.pyc172040644editdlrm
adapters.pyo172040644editdlrm
api.py57950644editdlrm
api.pyc66330644editdlrm
api.pyo66330644editdlrm
auth.py80750644editdlrm
auth.pyc90770644editdlrm
auth.pyo90770644editdlrm
certs.py6490644editdlrm
certs.pyc9230644editdlrm
certs.pyo9230644editdlrm
compat.py15490644editdlrm
compat.pyc17070644editdlrm
compat.pyo17070644editdlrm
cookies.py175640644editdlrm
cookies.pyc217090644editdlrm
cookies.pyo217090644editdlrm
exceptions.py27760644editdlrm
exceptions.pyc61210644editdlrm
exceptions.pyo61210644editdlrm
hooks.py7670644editdlrm
hooks.pyc12400644editdlrm
hooks.pyo12400644editdlrm
models.py295300644editdlrm
models.pyc264090644editdlrm
models.pyo264090644editdlrm
sessions.py248970644editdlrm
sessions.pyc205480644editdlrm
sessions.pyo205480644editdlrm
status_codes.py33150644editdlrm
status_codes.pyc46290644editdlrm
status_codes.pyo46290644editdlrm
structures.py30170644editdlrm
structures.pyc54450644editdlrm
structures.pyo54450644editdlrm
utils.py222280644editdlrm
utils.pyc216640644editdlrm
utils.pyo216640644editdlrm
__init__.py22150644editdlrm
__init__.pyc28680644editdlrm
__init__.pyo28680644editdlrm
Edit: /opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyc (9077B)
ó ¹Ö#Wc@sdZddlZddlZddlZddlZddlZddlmZddlm Z m Z ddl m Z ddl mZmZddlmZd Zd Zd „Zd efd „ƒYZdefd„ƒ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_headertto_native_string(tcodess!application/x-www-form-urlencodedsmultipart/form-datacCs3dttd||fjdƒƒjƒƒ}|S(sReturns a Basic Auth string.sBasic s%s:%stlatin1(RRtencodetstrip(tusernametpasswordtauthstr((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyt_basic_auth_strs)tAuthBasecBseZdZd„ZRS(s4Base class that all auth implementations derive fromcCstdƒ‚dS(NsAuth hooks must be callable.(tNotImplementedError(tselftr((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyt__call__(s(t__name__t __module__t__doc__R(((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyR%st HTTPBasicAuthcBs2eZdZd„Zd„Zd„Zd„ZRS(s?Attaches HTTP Basic Authentication to the given Request object.cCs||_||_dS(N(R R (RR R ((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyt__init__.s cCs:t|jt|ddƒk|jt|ddƒkgƒS(NR R (tallR tgetattrtNoneR (Rtother((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyt__eq__2scCs ||k S(N((RR((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyt__ne__8scCs t|j|jƒ|jd<|S(Nt Authorization(R R R theaders(RR((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyR;s(RRRRRRR(((s>/opt/alt/python27/lib/python2.7/site-packages/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(R R R R(RR((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyRBs(RRRR(((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyR @stHTTPDigestAuthcBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( s@Attaches HTTP Digest Authentication to the given Request object.cCs%||_||_tjƒ|_dS(N(R R t threadingtlocalt _thread_local(RR R ((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyRIs  cCsat|jdƒs]t|j_d|j_d|j_i|j_d|j_d|j_ ndS(Ntinitti( thasattrR$tTrueR%t last_noncet nonce_counttchalRtpost num_401_calls(R((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pytinit_per_thread_stateOs     csN|jjd}|jjd}|jjjdƒ}|jjjdƒ}|jjjdƒ}d‰|dkrzd}n |jƒ}|dksž|dkr°d„} | ‰n|d krÎd „} | ‰n‡fd †} ˆdkrídSd} t|ƒ} | jp d }| jr+|d | j7}nd|j||j f}d||f}ˆ|ƒ}ˆ|ƒ}||jj kr“|jj d7_ n d|j_ d|jj }t |jj ƒj dƒ}||j dƒ7}|tjƒj dƒ7}|tjdƒ7}tj|ƒjƒd }|dkrJˆd|||fƒ}n|sl| |d||fƒ}nP|dksd|jdƒkr¸d|||d|f}| ||ƒ}ndS||j_ d|j||||f}|rû|d|7}n|r|d|7}n| r)|d| 7}n|rF|d||f7}nd|S(Ntrealmtnoncetqopt algorithmtopaquetMD5sMD5-SESScSs4t|tƒr!|jdƒ}ntj|ƒjƒS(Nsutf-8(t isinstanceRRthashlibtmd5t hexdigest(tx((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pytmd5_utf8hstSHAcSs4t|tƒr!|jdƒ}ntj|ƒjƒS(Nsutf-8(R5RRR6tsha1R8(R9((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pytsha_utf8nscsˆd||fƒS(Ns%s:%s((tstd(t hash_utf8(s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyttst/t?s%s:%s:%ss%s:%sis%08xsutf-8iitautht,s%s:%s:%s:%s:%ss>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(R$R+tgetRtupperRtpathtqueryR R R)R*RRttimetctimetosturandomR6R<R8tsplit(RtmethodturlR/R0R1R2R3t _algorithmR:R=tKDtentdigtp_parsedRHtA1tA2tHA1tHA2tncvalueR>tcnoncetrespdigtnoncebittbase((R@s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pytbuild_digest_headerYsr               ! cKs|jrd|j_ndS(s)Reset num_401_calls counter on redirects.iN(t is_redirectR$R-(RRtkwargs((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pythandle_redirect°s cKs_|jjd k r.|jjj|jjƒn|jjddƒ}d|jƒkrO|jj dkrO|jj d7_ t j ddt j ƒ}t |jd|ddƒƒ|j_|j|jƒ|jjƒ}t|j|j|jƒ|j|jƒ|j|j|jƒ|jd <|jj||}|jj|ƒ||_|Sd|j_ |S( s:Takes the given response and tries digest-auth, if needed.swww-authenticateR&tdigestiisdigest tflagstcountRN(R$R,RtrequesttbodytseekRRFtlowerR-tretcompilet IGNORECASERtsubR+tcontenttclosetcopyRt_cookiestrawtprepare_cookiesR^RORPt connectiontsendthistorytappend(RRR`ts_authtpattprept_r((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyt handle_401µs($$   cCs§|jƒ|jjr8|j|j|jƒ|jd/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyR×s  "  cCs:t|jt|ddƒk|jt|ddƒkgƒS(NR R (RR RRR (RR((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyRëscCs ||k S(N((RR((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyRñs( RRRRR.R^RaR{RRR(((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyR!Gs  W  "  (RRLRiRJR6R"tbase64RtcompatRRtcookiesRtutilsRRt status_codesRtCONTENT_TYPE_FORM_URLENCODEDtCONTENT_TYPE_MULTI_PARTR tobjectRRR R!(((s>/opt/alt/python27/lib/python2.7/site-packages/requests/auth.pyts"