Format: application/x-python-code
1 o
2
3 C'hs. � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl m
4 Z
5 ddlmZ ddl
6 mZmZmZ ddlmZmZmZ ejrId d lmZ g d
7 �ZG dd� d�ZG d
8 d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� dej�ZdS )� )�annotationsN)� b64encode)�parse_http_list� )�
9 ProtocolError)�Cookies�Request�Response)�to_bytes�to_str�unquote)�_Hash)�Auth� BasicAuth�
10 DigestAuth� NetRCAuthc @ s6 e Zd ZdZdZdZddd�Zdd d
11 �Zddd
12 �ZdS )r a�
13 Base class for all authentication schemes.
14
15 To implement a custom authentication scheme, subclass `Auth` and override
16 the `.auth_flow()` method.
17
18 If the authentication scheme does I/O such as disk access or network calls, or uses
19 synchronization primitives such as locks, you should override `.sync_auth_flow()`
20 and/or `.async_auth_flow()` instead of `.auth_flow()` to provide specialized
21 implementations that will be used by `Client` and `AsyncClient` respectively.
22 F�requestr �return�)typing.Generator[Request, Response, None]c c s � |V dS )a
23 Execute the authentication flow.
24
25 To dispatch a request, `yield` it:
26
27 ```
28 yield request
29 ```
30
31 The client will `.send()` the response back into the flow generator. You can
32 access it like so:
33
34 ```
35 response = yield request
36 ```
37
38 A `return` (or reaching the end of the generator) will result in the
39 client returning the last response obtained from the server.
40
41 You can dispatch as many requests as is necessary.
42 N� ��selfr r r �AC:\Users\shubh\Videos\agent\nova\Lib\site-packages\httpx/_auth.py� auth_flow&