aeat.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 PersistedSessionDataProtocol(*args, **kwargs)[source]

Bases: Protocol

Minimal surface the application layer reads from a persisted session record.

property metadata: Mapping[str, object]

Provider-specific session metadata.

class SessionStoreProtocol(*args, **kwargs)[source]

Bases: Protocol

Structural 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.

exists(path)[source]

Return whether a session is persisted at logical path.

Return type:

bool

Parameters:

path (Path)

load(path)[source]

Load persisted session data for path.

Returns a PersistedSessionDataProtocol, or None when absent.

Return type:

PersistedSessionDataProtocol | None

Parameters:

path (Path)

delete(path)[source]

Delete persisted session data at path, returning True when removed.

Return type:

bool

Parameters:

path (Path)