"""Protocol definitions for the application-layer auth session boundary.These protocols declare the interface the application layer depends on forpersisted auth session management. Concrete implementations live in theadapter layer (adapters/outbound/aeat/auth/_session_store.py) and satisfythese protocols structurally.:class:`SessionStoreProtocol` returns :class:`PersistedSessionDataProtocol`records to the persisted-session service."""from__future__importannotationsfromcollections.abcimportMappingfrompathlibimportPathfromtypingimportProtocol,runtime_checkable
[docs]@runtime_checkableclassPersistedSessionDataProtocol(Protocol):"""Minimal surface the application layer reads from a persisted session record."""@propertydefmetadata(self)->Mapping[str,object]:"""Provider-specific session metadata."""...
[docs]@runtime_checkableclassSessionStoreProtocol(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. """
[docs]defexists(self,path:Path)->bool:"""Return whether a session is persisted at logical ``path``."""...
[docs]defload(self,path:Path)->PersistedSessionDataProtocol|None:"""Load persisted session data for ``path``. Returns a :class:`PersistedSessionDataProtocol`, or ``None`` when absent. """...
[docs]defdelete(self,path:Path)->bool:"""Delete persisted session data at ``path``, returning True when removed."""...