Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
the-ress committed Feb 9, 2024
1 parent ffd4298 commit 4e78f7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyprusalink/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
from httpx._auth import _DigestAuthChallenge
from pyprusalink.types import Conflict, InvalidAuth, NotFound


# TODO remove after the following issues are fixed (in all supported firmwares for the latter one):
# https://github.com/encode/httpx/pull/3045
# https://github.com/prusa3d/Prusa-Firmware-Buddy/pull/3665
class DigestAuthWorkaround(DigestAuth):
"""Wrapper for httpx.DigestAuth to work around a firmware issue."""

# Taken from httpx.DigestAuth and modified
# https://github.com/encode/httpx/blob/c6907c22034e2739c4c1af89908e3c9f90602788/httpx/_auth.py#L258
def _build_auth_header(
Expand Down Expand Up @@ -43,7 +46,9 @@ def digest(data: bytes) -> bytes:

return "Digest " + self._get_header_value(format_args)


class ApiClient:

def __init__(
self, async_client: AsyncClient, host: str, username: str, password: str
) -> None:
Expand Down

0 comments on commit 4e78f7e

Please sign in to comment.