File: //proc/1233/root/usr/local/lib/python3.10/dist-packages/httpx/__pycache__/_auth.cpython-310.pyc
o
���gs. � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl m
Z
ddlmZ ddl
mZmZmZ ddlmZmZmZ ejrId d lmZ g d
�ZG dd� d�ZG d
d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� dej�ZdS )� )�annotationsN)� b64encode)�parse_http_list� )�
ProtocolError)�Cookies�Request�Response)�to_bytes�to_str�unquote)�_Hash)�Auth� BasicAuth�
DigestAuth� NetRCAuthc @ s6 e Zd ZdZdZdZddd�Zdd d
�Zddd
�ZdS )r a�
Base class for all authentication schemes.
To implement a custom authentication scheme, subclass `Auth` and override
the `.auth_flow()` method.
If the authentication scheme does I/O such as disk access or network calls, or uses
synchronization primitives such as locks, you should override `.sync_auth_flow()`
and/or `.async_auth_flow()` instead of `.auth_flow()` to provide specialized
implementations that will be used by `Client` and `AsyncClient` respectively.
F�requestr �return�)typing.Generator[Request, Response, None]c c s � |V dS )a
Execute the authentication flow.
To dispatch a request, `yield` it:
```
yield request
```
The client will `.send()` the response back into the flow generator. You can
access it like so:
```
response = yield request
```
A `return` (or reaching the end of the generator) will result in the
client returning the last response obtained from the server.
You can dispatch as many requests as is necessary.
N� ��selfr r r �6/usr/local/lib/python3.10/dist-packages/httpx/_auth.py� auth_flow&