From de02736728715847fc6006d6c70f3c8b004c3b5c Mon Sep 17 00:00:00 2001 From: Vizonex Date: Tue, 7 Apr 2026 21:54:42 -0500 Subject: [PATCH 1/2] rename ABC class to AbstractRemote to not be confused with abc.ABC --- aiohttp_remotes/abc.py | 2 +- aiohttp_remotes/basic_auth.py | 4 ++-- aiohttp_remotes/cloudflare.py | 4 ++-- aiohttp_remotes/forwarded.py | 6 +++--- aiohttp_remotes/secure.py | 4 ++-- aiohttp_remotes/x_forwarded.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/aiohttp_remotes/abc.py b/aiohttp_remotes/abc.py index 21095079..48de74d8 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/basic_auth.py b/aiohttp_remotes/basic_auth.py index 0358eaae..f7105192 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 cfdf3bd6..fb56693c 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 3589a1c9..7c06f67f 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 83467ce2..063bf899 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 b3ad7620..efbbb322 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) From fc1313a0e81807237d60ce187d318d41dbb95a04 Mon Sep 17 00:00:00 2001 From: Vizonex Date: Tue, 7 Apr 2026 22:04:27 -0500 Subject: [PATCH 2/2] forgot to rename this hold on... --- aiohttp_remotes/allowed_hosts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiohttp_remotes/allowed_hosts.py b/aiohttp_remotes/allowed_hosts.py index f400db9b..2f922699 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] = ("*",),