Skip to content
Myr

test_auth.py

This file

Path

tests/client/test_auth.py

370 lines · 11.9 KiB · Python

Last changed by

Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b

History of this file

Take it

The walk stopped after 200 commits: lines older than 80eafe8 point at it.

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

line 1why, one step back
1import hashlib

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 2–4why, one step back
2import json
3import os4

Refactor client functionality into middleware (#268)Florimond Mancabefore adoption40e6e8c

lines 5–6why, one step back
5import pytest
6

Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b

lines 7–9why, one step back
7from httpx import URL, Client, DigestAuth, ProtocolError, Request, Response
8from httpx.config import CertTypes, TimeoutTypes, VerifyTypes9from httpx.dispatch.base import Dispatcher

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 10–11why, one step back
10
11

Drop sync (#544)Tom Christiebefore adoption206c537

line 12why, one step back
12class MockDispatch(Dispatcher):

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

lines 13–16why, one step back
13 def __init__(self, auth_header: str = "", status_code: int = 200) -> None:
14 self.auth_header = auth_header15 self.status_code = status_code16

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 17–18why, one step back
17 async def send(
18 self,

Drop sync (#544)Tom Christiebefore adoption206c537

line 19why, one step back
19 request: Request,

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 20–22why, one step back
20 verify: VerifyTypes = None,
21 cert: CertTypes = None,22 timeout: TimeoutTypes = None,

Drop sync (#544)Tom Christiebefore adoption206c537

line 23why, one step back
23 ) -> Response:

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

line 24why, one step back
24 headers = [("www-authenticate", self.auth_header)] if self.auth_header else []

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

line 25why, one step back
25 body = json.dumps({"auth": request.headers.get("Authorization")}).encode()

Drop sync (#544)Tom Christiebefore adoption206c537

line 26why, one step back
26 return Response(

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

lines 27–28why, one step back
27 self.status_code, headers=headers, content=body, request=request
28 )

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 29–30why, one step back
29
30

Drop sync (#544)Tom Christiebefore adoption206c537

line 31why, one step back
31class MockDigestAuthDispatch(Dispatcher):

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 32–46why, one step back
32 def __init__(
33 self,34 algorithm: str = "SHA-256",35 send_response_after_attempt: int = 1,36 qop: str = "auth",37 regenerate_nonce: bool = True,38 ) -> None:39 self.algorithm = algorithm40 self.send_response_after_attempt = send_response_after_attempt41 self.qop = qop42 self._regenerate_nonce = regenerate_nonce43 self._response_count = 04445 async def send(46 self,

Drop sync (#544)Tom Christiebefore adoption206c537

line 47why, one step back
47 request: Request,

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 48–50why, one step back
48 verify: VerifyTypes = None,
49 cert: CertTypes = None,50 timeout: TimeoutTypes = None,

Drop sync (#544)Tom Christiebefore adoption206c537

line 51why, one step back
51 ) -> Response:

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 52–55why, one step back
52 if self._response_count < self.send_response_after_attempt:
53 return self.challenge_send(request)5455 body = json.dumps({"auth": request.headers.get("Authorization")}).encode()

Drop sync (#544)Tom Christiebefore adoption206c537

line 56why, one step back
56 return Response(200, content=body, request=request)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

line 57why, one step back
57

Drop sync (#544)Tom Christiebefore adoption206c537

line 58why, one step back
58 def challenge_send(self, request: Request) -> Response:

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 59–82why, one step back
59 self._response_count += 1
60 nonce = (61 hashlib.sha256(os.urandom(8)).hexdigest()62 if self._regenerate_nonce63 else "ee96edced2a0b43e4869e96ebe27563f369c1205a049d06419bb51d8aeddf3d3"64 )65 challenge_data = {66 "nonce": nonce,67 "qop": self.qop,68 "opaque": (69 "ee6378f3ee14ebfd2fff54b70a91a7c9390518047f242ab2271380db0e14bda1"70 ),71 "algorithm": self.algorithm,72 "stale": "FALSE",73 }74 challenge_str = ", ".join(75 '{}="{}"'.format(key, value)76 for key, value in challenge_data.items()77 if value78 )7980 headers = [81 ("www-authenticate", 'Digest realm="httpx@example.org", ' + challenge_str)82 ]

Drop sync (#544)Tom Christiebefore adoption206c537

line 83why, one step back
83 return Response(401, headers=headers, content=b"", request=request)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 84–85why, one step back
84
85

Drop sync (#544)Tom Christiebefore adoption206c537

lines 86–87why, one step back
86@pytest.mark.asyncio
87async def test_basic_auth():

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 88–90why, one step back
88 url = "https://example.org/"
89 auth = ("tomchristie", "password123")90

Drop sync (#544)Tom Christiebefore adoption206c537

lines 91–92why, one step back
91 client = Client(dispatch=MockDispatch())
92 response = await client.get(url, auth=auth)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 93–97why, one step back
93
94 assert response.status_code == 20095 assert response.json() == {"auth": "Basic dG9tY2hyaXN0aWU6cGFzc3dvcmQxMjM="}9697

Drop sync (#544)Tom Christiebefore adoption206c537

lines 98–99why, one step back
98@pytest.mark.asyncio
99async def test_basic_auth_in_url():

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 100–101why, one step back
100 url = "https://tomchristie:password123@example.org/"
101

Drop sync (#544)Tom Christiebefore adoption206c537

lines 102–103why, one step back
102 client = Client(dispatch=MockDispatch())
103 response = await client.get(url)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 104–108why, one step back
104
105 assert response.status_code == 200106 assert response.json() == {"auth": "Basic dG9tY2hyaXN0aWU6cGFzc3dvcmQxMjM="}107108

Drop sync (#544)Tom Christiebefore adoption206c537

lines 109–110why, one step back
109@pytest.mark.asyncio
110async def test_basic_auth_on_session():

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 111–113why, one step back
111 url = "https://example.org/"
112 auth = ("tomchristie", "password123")113

Drop sync (#544)Tom Christiebefore adoption206c537

lines 114–115why, one step back
114 client = Client(dispatch=MockDispatch(), auth=auth)
115 response = await client.get(url)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 116–120why, one step back
116
117 assert response.status_code == 200118 assert response.json() == {"auth": "Basic dG9tY2hyaXN0aWU6cGFzc3dvcmQxMjM="}119120

Drop sync (#544)Tom Christiebefore adoption206c537

lines 121–122why, one step back
121@pytest.mark.asyncio
122async def test_custom_auth():

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 123–128why, one step back
123 url = "https://example.org/"
124125 def auth(request):126 request.headers["Authorization"] = "Token 123"127 return request128

Drop sync (#544)Tom Christiebefore adoption206c537

lines 129–130why, one step back
129 client = Client(dispatch=MockDispatch())
130 response = await client.get(url, auth=auth)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 131–135why, one step back
131
132 assert response.status_code == 200133 assert response.json() == {"auth": "Token 123"}134135

Drop sync (#544)Tom Christiebefore adoption206c537

lines 136–137why, one step back
136@pytest.mark.asyncio
137async def test_netrc_auth():

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 138–140why, one step back
138 os.environ["NETRC"] = "tests/.netrc"
139 url = "http://netrcexample.org"140

Drop sync (#544)Tom Christiebefore adoption206c537

lines 141–142why, one step back
141 client = Client(dispatch=MockDispatch())
142 response = await client.get(url)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 143–149why, one step back
143
144 assert response.status_code == 200145 assert response.json() == {146 "auth": "Basic ZXhhbXBsZS11c2VybmFtZTpleGFtcGxlLXBhc3N3b3Jk"147 }148149

Drop sync (#544)Tom Christiebefore adoption206c537

line 150why, one step back
150@pytest.mark.asyncio

Ensure Authorization header has priority over .netrcTom Christiebefore adoption43331cf

lines 151–162why, one step back
151async def test_auth_header_has_priority_over_netrc():
152 os.environ["NETRC"] = "tests/.netrc"153 url = "http://netrcexample.org"154155 client = Client(dispatch=MockDispatch())156 response = await client.get(url, headers={"Authorization": "Override"})157158 assert response.status_code == 200159 assert response.json() == {"auth": "Override"}160161162@pytest.mark.asyncio

Drop sync (#544)Tom Christiebefore adoption206c537

line 163why, one step back
163async def test_trust_env_auth():

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 164–166why, one step back
164 os.environ["NETRC"] = "tests/.netrc"
165 url = "http://netrcexample.org"166

Drop sync (#544)Tom Christiebefore adoption206c537

lines 167–168why, one step back
167 client = Client(dispatch=MockDispatch())
168 response = await client.get(url, trust_env=False)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 169–172why, one step back
169
170 assert response.status_code == 200171 assert response.json() == {"auth": None}172

Drop sync (#544)Tom Christiebefore adoption206c537

lines 173–174why, one step back
173 client = Client(dispatch=MockDispatch(), trust_env=False)
174 response = await client.get(url, trust_env=True)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 175–188why, one step back
175
176 assert response.status_code == 200177 assert response.json() == {178 "auth": "Basic ZXhhbXBsZS11c2VybmFtZTpleGFtcGxlLXBhc3N3b3Jk"179 }180181182def test_auth_hidden_url():183 url = "http://example-username:example-password@example.org/"184 expected = "URL('http://example-username:[secure]@example.org/')"185 assert url == URL(url)186 assert expected == repr(URL(url))187188

Drop sync (#544)Tom Christiebefore adoption206c537

lines 189–190why, one step back
189@pytest.mark.asyncio
190async def test_auth_hidden_header():

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 191–193why, one step back
191 url = "https://example.org/"
192 auth = ("example-username", "example-password")193

Drop sync (#544)Tom Christiebefore adoption206c537

lines 194–195why, one step back
194 client = Client(dispatch=MockDispatch())
195 response = await client.get(url, auth=auth)

Remove usage of loop.create_task in ASGIDispatch (#261)Florimond Mancabefore adoption80eafe8

lines 196–197why, one step back
196
197 assert "'authorization': '[secure]'" in str(response.request.headers)

Refactor client functionality into middleware (#268)Florimond Mancabefore adoption40e6e8c

lines 198–199why, one step back
198
199

Drop sync (#544)Tom Christiebefore adoption206c537

lines 200–201why, one step back
200@pytest.mark.asyncio
201async def test_auth_invalid_type():

Refactor client functionality into middleware (#268)Florimond Mancabefore adoption40e6e8c

line 202why, one step back
202 url = "https://example.org/"

Drop sync (#544)Tom Christiebefore adoption206c537

lines 203–205why, one step back
203 client = Client(dispatch=MockDispatch(), auth="not a tuple, not a callable")
204 with pytest.raises(TypeError):205 await client.get(url)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 206–207why, one step back
206
207

Drop sync (#544)Tom Christiebefore adoption206c537

lines 208–209why, one step back
208@pytest.mark.asyncio
209async def test_digest_auth_returns_no_auth_if_no_digest_header_in_response():

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 210–212why, one step back
210 url = "https://example.org/"
211 auth = DigestAuth(username="tomchristie", password="password123")212

Drop sync (#544)Tom Christiebefore adoption206c537

lines 213–214why, one step back
213 client = Client(dispatch=MockDispatch())
214 response = await client.get(url, auth=auth)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 215–219why, one step back
215
216 assert response.status_code == 200217 assert response.json() == {"auth": None}218219

Drop sync (#544)Tom Christiebefore adoption206c537

lines 220–221why, one step back
220@pytest.mark.asyncio
221async def test_digest_auth_200_response_including_digest_auth_header():

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

lines 222–225why, one step back
222 url = "https://example.org/"
223 auth = DigestAuth(username="tomchristie", password="password123")224 auth_header = 'Digest realm="realm@host.com",qop="auth",nonce="abc",opaque="xyz"'225

Drop sync (#544)Tom Christiebefore adoption206c537

lines 226–227why, one step back
226 client = Client(dispatch=MockDispatch(auth_header=auth_header, status_code=200))
227 response = await client.get(url, auth=auth)

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

lines 228–232why, one step back
228
229 assert response.status_code == 200230 assert response.json() == {"auth": None}231232

Drop sync (#544)Tom Christiebefore adoption206c537

lines 233–234why, one step back
233@pytest.mark.asyncio
234async def test_digest_auth_401_response_without_digest_auth_header():

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

lines 235–237why, one step back
235 url = "https://example.org/"
236 auth = DigestAuth(username="tomchristie", password="password123")237

Drop sync (#544)Tom Christiebefore adoption206c537

lines 238–239why, one step back
238 client = Client(dispatch=MockDispatch(auth_header="", status_code=401))
239 response = await client.get(url, auth=auth)

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

lines 240–244why, one step back
240
241 assert response.status_code == 401242 assert response.json() == {"auth": None}243244

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 245–257why, one step back
245@pytest.mark.parametrize(
246 "algorithm,expected_hash_length,expected_response_length",247 [248 ("MD5", 64, 32),249 ("MD5-SESS", 64, 32),250 ("SHA", 64, 40),251 ("SHA-SESS", 64, 40),252 ("SHA-256", 64, 64),253 ("SHA-256-SESS", 64, 64),254 ("SHA-512", 64, 128),255 ("SHA-512-SESS", 64, 128),256 ],257)

Drop sync (#544)Tom Christiebefore adoption206c537

lines 258–259why, one step back
258@pytest.mark.asyncio
259async def test_digest_auth(algorithm, expected_hash_length, expected_response_length):

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 260–262why, one step back
260 url = "https://example.org/"
261 auth = DigestAuth(username="tomchristie", password="password123")262

Drop sync (#544)Tom Christiebefore adoption206c537

lines 263–264why, one step back
263 client = Client(dispatch=MockDigestAuthDispatch(algorithm=algorithm))
264 response = await client.get(url, auth=auth)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 265–284why, one step back
265
266 assert response.status_code == 200267 auth = response.json()["auth"]268 assert auth.startswith("Digest ")269270 response_fields = [field.strip() for field in auth[auth.find(" ") :].split(",")]271 digest_data = dict(field.split("=") for field in response_fields)272273 assert digest_data["username"] == '"tomchristie"'274 assert digest_data["realm"] == '"httpx@example.org"'275 assert "nonce" in digest_data276 assert digest_data["uri"] == '"/"'277 assert len(digest_data["response"]) == expected_response_length + 2 # extra quotes278 assert len(digest_data["opaque"]) == expected_hash_length + 2279 assert digest_data["algorithm"] == algorithm280 assert digest_data["qop"] == "auth"281 assert digest_data["nc"] == "00000001"282 assert len(digest_data["cnonce"]) == 16 + 2283284

Drop sync (#544)Tom Christiebefore adoption206c537

lines 285–286why, one step back
285@pytest.mark.asyncio
286async def test_digest_auth_no_specified_qop():

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 287–289why, one step back
287 url = "https://example.org/"
288 auth = DigestAuth(username="tomchristie", password="password123")289

Drop sync (#544)Tom Christiebefore adoption206c537

lines 290–291why, one step back
290 client = Client(dispatch=MockDigestAuthDispatch(qop=None))
291 response = await client.get(url, auth=auth)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 292–311why, one step back
292
293 assert response.status_code == 200294 auth = response.json()["auth"]295 assert auth.startswith("Digest ")296297 response_fields = [field.strip() for field in auth[auth.find(" ") :].split(",")]298 digest_data = dict(field.split("=") for field in response_fields)299300 assert "qop" not in digest_data301 assert "nc" not in digest_data302 assert "cnonce" not in digest_data303 assert digest_data["username"] == '"tomchristie"'304 assert digest_data["realm"] == '"httpx@example.org"'305 assert len(digest_data["nonce"]) == 64 + 2 # extra quotes306 assert digest_data["uri"] == '"/"'307 assert len(digest_data["response"]) == 64 + 2308 assert len(digest_data["opaque"]) == 64 + 2309 assert digest_data["algorithm"] == "SHA-256"310311

Additional DigestAuth tests (#334)Yeray Diaz Diazbefore adoption1cd9156

line 312why, one step back
312@pytest.mark.parametrize("qop", ("auth, auth-int", "auth,auth-int", "unknown,auth"))

Drop sync (#544)Tom Christiebefore adoption206c537

lines 313–314why, one step back
313@pytest.mark.asyncio
314async def test_digest_auth_qop_including_spaces_and_auth_returns_auth(qop: str):

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 315–317why, one step back
315 url = "https://example.org/"
316 auth = DigestAuth(username="tomchristie", password="password123")317

Drop sync (#544)Tom Christiebefore adoption206c537

lines 318–319why, one step back
318 client = Client(dispatch=MockDigestAuthDispatch(qop=qop))
319 await client.get(url, auth=auth)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 320–321why, one step back
320
321

Drop sync (#544)Tom Christiebefore adoption206c537

lines 322–323why, one step back
322@pytest.mark.asyncio
323async def test_digest_auth_qop_auth_int_not_implemented():

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 324–325why, one step back
324 url = "https://example.org/"
325 auth = DigestAuth(username="tomchristie", password="password123")

Drop sync (#544)Tom Christiebefore adoption206c537

line 326why, one step back
326 client = Client(dispatch=MockDigestAuthDispatch(qop="auth-int"))

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 327–328why, one step back
327
328 with pytest.raises(NotImplementedError):

Drop sync (#544)Tom Christiebefore adoption206c537

line 329why, one step back
329 await client.get(url, auth=auth)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 330–331why, one step back
330
331

Drop sync (#544)Tom Christiebefore adoption206c537

lines 332–333why, one step back
332@pytest.mark.asyncio
333async def test_digest_auth_qop_must_be_auth_or_auth_int():

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 334–335why, one step back
334 url = "https://example.org/"
335 auth = DigestAuth(username="tomchristie", password="password123")

Drop sync (#544)Tom Christiebefore adoption206c537

line 336why, one step back
336 client = Client(dispatch=MockDigestAuthDispatch(qop="not-auth"))

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 337–338why, one step back
337
338 with pytest.raises(ProtocolError):

Drop sync (#544)Tom Christiebefore adoption206c537

line 339why, one step back
339 await client.get(url, auth=auth)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 340–341why, one step back
340
341

Drop sync (#544)Tom Christiebefore adoption206c537

lines 342–343why, one step back
342@pytest.mark.asyncio
343async def test_digest_auth_incorrect_credentials():

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 344–346why, one step back
344 url = "https://example.org/"
345 auth = DigestAuth(username="tomchristie", password="password123")346

Drop sync (#544)Tom Christiebefore adoption206c537

lines 347–348why, one step back
347 client = Client(dispatch=MockDigestAuthDispatch(send_response_after_attempt=2))
348 response = await client.get(url, auth=auth)

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 349–362why, one step back
349
350 assert response.status_code == 401351352353@pytest.mark.parametrize(354 "auth_header",355 [356 'Digest realm="httpx@example.org", qop="auth"', # missing fields357 'realm="httpx@example.org", qop="auth"', # not starting with Digest358 'DigestZ realm="httpx@example.org", qop="auth"'359 'qop="auth,auth-int",nonce="abc",opaque="xyz"',360 'Digest realm="httpx@example.org", qop="auth,au', # malformed fields list361 ],362)

Drop sync (#544)Tom Christiebefore adoption206c537

lines 363–364why, one step back
363@pytest.mark.asyncio
364async def test_digest_auth_raises_protocol_error_on_malformed_header(auth_header: str):

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 365–366why, one step back
365 url = "https://example.org/"
366 auth = DigestAuth(username="tomchristie", password="password123")

Drop sync (#544)Tom Christiebefore adoption206c537

line 367why, one step back
367 client = Client(dispatch=MockDispatch(auth_header=auth_header, status_code=401))

Add DigestAuth middleware (#332)Yeray Diaz Diazbefore adoptionfd3b69d

lines 368–369why, one step back
368
369 with pytest.raises(ProtocolError):

Drop sync (#544)Tom Christiebefore adoption206c537

line 370why, one step back
370 await client.get(url, auth=auth)