관리-도구
편집 파일: auth.cpython-39.pyc
a ��Re�/ � @ s* d Z ddlZddlmZmZmZmZmZ ddl m Z mZ ddlm Z mZ ddlmZ ddlmZ ddlmZmZmZmZmZ dd lmZ ee�Zeeeef ZzddlaW nL e y� daY n8 e!y� Z" z e�#d ee"�� daW Y dZ"["n dZ"["0 0 ee ee ee d�dd �Z$G dd� de �Z%dS )z�Network Authentication Helpers Contains interface (MultiDomainBasicAuth) and associated glue code for providing credentials in the context of network requests. � N)�Any�Dict�List�Optional�Tuple)�AuthBase� HTTPBasicAuth)�Request�Response)�get_netrc_auth)� getLogger)�ask� ask_input�ask_password�remove_auth_from_url�split_auth_netloc_from_url)�AuthInfo�*Keyring is skipped due to an exception: %s)�url�username�returnc C s� | rt sdS z~z t j}W n ty* Y n40 t�d| � || |�}|durX|j|jfW S W dS |r�t�d| � 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 )�keyring�get_credential�AttributeError�logger�debugr �password�get_password� Exception�warning�str)r r r �credr �exc� r# ��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/network/auth.py�get_keyring_auth( s0 �r% c @ s� e Zd Zd eeee dd�dd�Zeee d�dd�Zd!eeee d �dd�Z eeeee ee f d �dd�Ze e d�dd�Zeeee ee ef d�dd�Zed�dd�Zeeed�dd�Zeedd�dd�Zeedd�dd�ZdS )"�MultiDomainBasicAuthTN)� prompting� index_urlsr c C s || _ || _i | _d | _d S )N)r'