MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / __init__

Method __init__

examples/basic_auth_middleware.py:34–37  ·  view source on GitHub ↗
(self, username: str, password: str)

Source from the content-addressed store, hash-verified

32 """Middleware that adds Basic Authentication to all requests."""
33
34 def __init__(self, username: str, password: str) -> None:
35 self.username = username
36 self.password = password
37 self._auth_header = self._encode_credentials()
38
39 def _encode_credentials(self) -> str:
40 """Encode username and password to base64."""

Callers

nothing calls this directly

Calls 1

_encode_credentialsMethod · 0.95

Tested by

no test coverage detected