3 Re- @ s( d Z ddlZddlmZmZ ddlmZ ddlmZ ddl mZmZm Z mZmZ ddlmZ erddlmZmZmZmZmZ dd lmZ dd lmZmZ eeeef Zeje Z!yddl"a"W nN e#k r da"Y n8 e$k r Z% ze!j&dee% da"W Y ddZ%[%X nX dd Z'G dd deZ(dS )zNetwork Authentication Helpers Contains interface (MultiDomainBasicAuth) and associated glue code for providing credentials in the context of network requests. N)AuthBase HTTPBasicAuth)get_netrc_auth)parse)ask ask_inputask_passwordremove_auth_from_urlsplit_auth_netloc_from_url)MYPY_CHECK_RUNNING)DictOptionalTupleListAny)AuthInfo)ResponseRequestz*Keyring is skipped due to an exception: %sc C s | st rdS yzy t j}W n tk r0 Y n0X tjd| || |}|dk r\|j|jfS dS |rtjd| t j| |}|r||fS W n6 tk r } ztj dt | da W Y dd}~X nX dS )z3Return the tuple auth for a given url from keyring.Nz'Getting credentials from keyring for %sz$Getting password from keyring for %sz*Keyring is skipped due to an exception: %s)keyringget_credentialAttributeErrorloggerdebugusernamepasswordget_password Exceptionwarningstr)urlr r credr exc r" /builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el9.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/network/auth.pyget_keyring_auth, s, r$ c @ s` e Zd ZdddZdd ZdddZd d Zdd Zd d Zdd Z dd Z dd Zdd ZdS )MultiDomainBasicAuthTNc C s || _ || _i | _d | _d S )N) prompting index_urls passwords_credentials_to_save)selfr&