Skip to content

common_auth.authenticators.base

The shared request-authentication pipeline; schemes only transform prepared requests.

Classes

BaseAuthenticator

Bases: ABC

Prepare, scope-check and apply one scheme through a shared HTTP flow.

Holds immutable configuration only; each flow keeps its own request and challenge budget. Schemes may hold borrowed credential/token collaborators. HTTP owns exchanges and cookies. Authentication owns credential application and explicit challenge recovery; there is no HTTP retry loop here.

__init__

def __init__(config: AuthenticatorConfig) -> None

Fields and properties declared here; inherited members belong to the bases above.

config

config = config

apply

async def apply(request: Request, *, prepare: Callable[[Request], Request]) -> AuthResult[Request]

Prepare before applying credentials; return the exact request to dispatch.

flow

async def flow(request: Request, *, prepare: Callable[[Request], Request]) -> AsyncGenerator[Request, HttpResponseHead]

One flow per operation; only an explicitly recoverable challenge permits replay.

requires_body

@staticmethod
def requires_body(_response: HttpResponseHead) -> bool

These authentication schemes only inspect response challenge headers.