a lj/ @ s* d Z ddlZddlmZmZmZmZmZ ddl m Z mZ ddlm Z mZ ddlmZ ddlmZ ddlmZmZmZmZmZ dd lmZ eeZeeeef ZzddlaW nL e y daY n8 e!y Z" z e#d ee" daW Y dZ"["n dZ"["0 0 ee ee ee ddd Z$G dd de Z%dS )zNetwork Authentication Helpers Contains interface (MultiDomainBasicAuth) and associated glue code for providing credentials in the context of network requests. N)AnyDictListOptionalTuple)AuthBase HTTPBasicAuth)RequestResponse)get_netrc_auth) getLogger)ask ask_inputask_passwordremove_auth_from_urlsplit_auth_netloc_from_url)AuthInfo*Keyring is skipped due to an exception: %s)urlusernamereturnc C s | rt sdS z~z t j}W n ty* Y n40 td| || |}|durX|j|jfW S W dS |rtd| t | |}|r||fW S W n8 ty } z t dt | da W Y d}~n d}~0 0 dS )z3Return the tuple auth for a given url from keyring.Nz'Getting credentials from keyring for %sz$Getting password from keyring for %sr )keyringget_credentialAttributeErrorloggerdebugr passwordZget_password Exceptionwarningstr)r r r Zcredr exc r! >/usr/lib/python3.9/site-packages/pip/_internal/network/auth.pyget_keyring_auth( s0 r# c @ s e Zd Zd eeee ddddZeee dddZd!eeee d ddZ eeeee ee f d ddZe e dddZeeee ee ef dddZedddZeeedddZeeddddZeeddddZdS )"MultiDomainBasicAuthTN) prompting index_urlsr c C s || _ || _i | _d | _d S )N)r% r&