cadrumo.application.auth.protocols module¶
Protocol definitions for the application-layer auth session boundary.
These protocols declare the interface the application layer depends on for
persisted auth session management. Concrete implementations live in the
adapter layer (adapters/outbound/aeat/auth/session_store.py) and satisfy
these protocols structurally.
SessionStoreProtocol returns PersistedSessionDataProtocol
records to the persisted-session service.
- class BrowserResponsePort(*args, **kwargs)[source]¶
Bases:
ProtocolMinimal response surface needed to classify an authentication probe.
- class BrowserPagePort(*args, **kwargs)[source]¶
Bases:
ProtocolMinimal page surface consumed by authentication providers.
- async goto(url, *, timeout=None)[source]¶
Navigate to
urland return its response, if any.- Return type:
- Parameters:
- class BrowserContextKwargs[source]¶
Bases:
TypedDictSubset of Playwright
Browser.new_context()keyword arguments.Only the kwargs that AEAT auth provisioners currently supply are declared here.
total=Falsemakes every key optional so callers can return a partial mapping.
- class BrowserContextProvisioner(*args, **kwargs)[source]¶
Bases:
ProtocolHook that decorates browser-context creation for auth providers.
Concrete outbound auth provisioners implement this protocol to add Playwright
new_context()kwargs.
- class BrowserContextPort(*args, **kwargs)[source]¶
Bases:
ProtocolMinimal browser context used by authentication providers.
- class BrowserSessionPort(*args, **kwargs)[source]¶
Bases:
ProtocolBrowser lifecycle required by concrete authentication providers.
- async create_context(*, provisioner=None, storage_state=None)[source]¶
Create a context with optional provider or persisted state.
- Return type:
- Parameters:
provisioner (BrowserContextProvisioner | None)
- class BrowserSessionFactoryPort(*args, **kwargs)[source]¶
Bases:
ProtocolAsync browser-session constructor accepted by auth composition.
- class PersistedSessionDataProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolMinimal surface the application layer reads from a persisted session record.
- class SessionStoreProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolStructural interface for the persisted browser session store.
The application layer depends on this protocol rather than the concrete adapter module so that application/auth/sessions.py does not carry a direct import from adapters/outbound/aeat/auth/session_store.py.
- load(path)[source]¶
Load persisted session data for
path.Returns a
PersistedSessionDataProtocol, orNonewhen absent.- Return type:
- Parameters:
path (Path)
- bind_session_store(store)[source]¶
Bind the encrypted outbound session store for one runtime scope.
- Return type:
- Parameters:
store (SessionStoreProtocol)