Source code for cadrumo.application.user_profile.profile_read_ports
"""Application-owned profile read capabilities.Calculation services consume a small, path-keyed profile projection. Theprojection is deliberately a capability rather than a repository lookup: theencrypted record/session implementation is composed by an outer adapter andthe application only sees the stable mapping and absence semantics."""from__future__importannotationsfromcollections.abcimportCallable,MappingfromdataclassesimportdataclassfromtypingimportProtocol
[docs]classProfilePathValuesReadPort(Protocol):"""Read the canonical path-keyed profile projection for one bucket."""
[docs]defload_path_values(self,*,bucket_id:str)->Mapping[str,str]|None:"""Return projected profile values, or ``None`` when the profile is absent."""...
[docs]@dataclass(frozen=True,slots=True)classProfileReadPorts:"""Required profile-read capabilities for a composed application path."""path_values:ProfilePathValuesReadPort
typeProfileReadPortsFactory=Callable[[str],ProfileReadPorts]"""Compose the profile-read capabilities for one profile bucket."""__all__=["ProfilePathValuesReadPort","ProfileReadPorts","ProfileReadPortsFactory"]