\hdZddlmZddlZddlmZddlmZddlmZddl m Z ejd e ee ZGd d eZy) z NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 )absolute_importN) getLogger)ntlm)HTTPSConnectionPool)HTTPSConnectiona#The 'urllib3.contrib.ntlmpool' module is deprecated and will be removed in urllib3 v2.0 release, urllib3 is not able to support it properly due to reasons listed in issue: https://github.com/urllib3/urllib3/issues/2282. If you are a user of this module please comment in the mentioned issue.cBeZdZdZdZfdZdZ dfd ZxZS)NTLMConnectionPoolzQ Implements an NTLM authentication version of an urllib3 connection pool httpsctt| |i|||_||_|j dd}|dj |_|d|_||_ y)z authurl is a random URL on the server that is protected by NTLM. user is the Windows user, probably in the DOMAIN\username format. pw is the password for the user. \rN) superr __init__authurlrawusersplitupperdomainuserpw)selfrrrargskwargs user_parts __class__s g/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.pyrzNTLMConnectionPool.__init__"s^  $0$A&A  ZZa(  m))+ qM cF|xjdz c_tjd|j|j|jddi}d}d}t |j|j }dtj|jz||<tjd ||jd |jd||j}t|j}tjd |j|jtjd |tjd |j!dd|_||j%d}d}|D]} | dddk(s | dd}|t'd|d||tj(|\} } tj*| |j,|j.|j0| } d| z||<tjd ||jd |jd||j}tjd |j|jtjd t|jtjd |j!dd|jdk7r?|jdk(r t'dt'd|jd|jd|_tjd|S)Nrz3Starting NTLM HTTPS connection no. %d: https://%s%s Connection Keep-Alive Authorizationzwww-authenticate)hostportzNTLM %szRequest headers: %sGETzResponse status: %s %szResponse headers: %szResponse data: %s [...]dz, zNTLM z Unexpected z response header: iz3Server rejected request: wrong username or passwordzWrong server response:  zConnection established)num_connectionslogdebugr#rrr$rcreate_NTLM_NEGOTIATE_MESSAGErrequest getresponsedictheadersstatusreasonreadfpr Exceptionparse_NTLM_CHALLENGE_MESSAGE create_NTLM_AUTHENTICATE_MESSAGErrr) rr1 req_header resp_headerconnresreshdrauth_header_valuesauth_header_valuesServerChallengeNegotiateFlagsauth_msgs r _new_connzNTLMConnectionPool._new_conn0s ! A  II LL   .$ ( DIIDII>($*L*L LL+    '1 UDLL$8 ckk" *CJJ C (&1 +SXXc];$K066t< # *A!u$%abE! *  $7BF;DWX  +/*K*K + '88 TYY TWWn ((2  '1 UDLL$8  *CJJ C ($s{{*;< +SXXZ-=> :: zzS  UVVcjj#**UV V *+ rc H|i}d|d<tt| |||||||S)Nr!r )rr urlopen) rmethodurlbodyr1retriesredirectassert_same_hostrs rrFzNTLMConnectionPool.urlopenss> ?G , '6 Cw;K  r)NNTT) __name__ __module__ __qualname____doc__schemerrDrF __classcell__)rs@rr r s6F AN  rr )rQ __future__rwarningsloggingrrrpackages.six.moves.http_clientrwarnDeprecationWarningrNr+r rrr\sR '"<  N g ,g r