diff --git a/aiohttp_remotes/abc.py b/aiohttp_remotes/abc.py index 2109507..48de74d 100644 --- a/aiohttp_remotes/abc.py +++ b/aiohttp_remotes/abc.py @@ -5,7 +5,7 @@ from aiohttp import web -class ABC(abc.ABC): +class AbstractRemote(abc.ABC): @abc.abstractmethod async def setup(self, app: web.Application) -> None: pass # pragma: no cover diff --git a/aiohttp_remotes/allowed_hosts.py b/aiohttp_remotes/allowed_hosts.py index f400db9..2f92269 100644 --- a/aiohttp_remotes/allowed_hosts.py +++ b/aiohttp_remotes/allowed_hosts.py @@ -2,7 +2,7 @@ from aiohttp import web -from .abc import ABC +from .abc import AbstractRemote class ANY: @@ -10,7 +10,7 @@ def __contains__(self, item: object) -> bool: return True -class AllowedHosts(ABC): +class AllowedHosts(AbstractRemote): def __init__( self, allowed_hosts: Iterable[str] = ("*",), diff --git a/aiohttp_remotes/basic_auth.py b/aiohttp_remotes/basic_auth.py index 0358eaa..f710519 100644 --- a/aiohttp_remotes/basic_auth.py +++ b/aiohttp_remotes/basic_auth.py @@ -6,10 +6,10 @@ from aiohttp import hdrs, web -from .abc import ABC +from .abc import AbstractRemote -class BasicAuth(ABC): +class BasicAuth(AbstractRemote): def __init__( self, username: str, diff --git a/aiohttp_remotes/cloudflare.py b/aiohttp_remotes/cloudflare.py index cfdf3bd..fb56693 100644 --- a/aiohttp_remotes/cloudflare.py +++ b/aiohttp_remotes/cloudflare.py @@ -4,12 +4,12 @@ import aiohttp from aiohttp import web -from .abc import ABC +from .abc import AbstractRemote from .exceptions import IPNetwork from .log import logger -class Cloudflare(ABC): +class Cloudflare(AbstractRemote): def __init__(self, client: Optional[aiohttp.ClientSession] = None) -> None: self._ip_networks: Set[IPNetwork] = set() self._client = client diff --git a/aiohttp_remotes/forwarded.py b/aiohttp_remotes/forwarded.py index 3589a1c..7c06f67 100644 --- a/aiohttp_remotes/forwarded.py +++ b/aiohttp_remotes/forwarded.py @@ -3,12 +3,12 @@ from aiohttp import web -from .abc import ABC +from .abc import AbstractRemote from .exceptions import IncorrectForwardedCount, RemoteError from .utils import TrustedOrig, parse_trusted_list, remote_ip -class ForwardedRelaxed(ABC): +class ForwardedRelaxed(AbstractRemote): def __init__(self, num: int = 1) -> None: self._num = num @@ -38,7 +38,7 @@ async def middleware( return await handler(request) -class ForwardedStrict(ABC): +class ForwardedStrict(AbstractRemote): def __init__(self, trusted: TrustedOrig, *, white_paths: Iterable[str] = ()): self._trusted = parse_trusted_list(trusted) self._white_paths = set(white_paths) diff --git a/aiohttp_remotes/secure.py b/aiohttp_remotes/secure.py index 83467ce..063bf89 100644 --- a/aiohttp_remotes/secure.py +++ b/aiohttp_remotes/secure.py @@ -4,12 +4,12 @@ from aiohttp import web -from .abc import ABC +from .abc import AbstractRemote from .log import logger @web.middleware -class Secure(ABC): +class Secure(AbstractRemote): def __init__( self, *, diff --git a/aiohttp_remotes/x_forwarded.py b/aiohttp_remotes/x_forwarded.py index b3ad762..efbbb32 100644 --- a/aiohttp_remotes/x_forwarded.py +++ b/aiohttp_remotes/x_forwarded.py @@ -7,7 +7,7 @@ from aiohttp import hdrs, web -from .abc import ABC +from .abc import AbstractRemote from .exceptions import ( IncorrectHostCount, IncorrectProtoCount, @@ -26,7 +26,7 @@ ) -class XForwardedBase(ABC): +class XForwardedBase(AbstractRemote): async def setup(self, app: web.Application) -> None: app.middlewares.append(self.middleware)