Source code for cadrumo.application.auth.apoderado_repository
"""Application-owned capability for persisted apoderado configuration.The application service owns the configuration model and its policy. Thismodule declares only the bucket-bound persistence surface that policy needs;the encrypted envelope, storage namespace, object-key derivation, and backenderrors remain implementation details of an outward adapter."""from__future__importannotationsfromtypingimportTYPE_CHECKING,ProtocolifTYPE_CHECKING:from...core.configimportSettingsfrom.apoderado_serviceimportApoderadoConfiguration
[docs]classApoderadoConfigurationRepository(Protocol):"""Bucket-bound persistence capability for one apoderado configuration."""
[docs]defload(self)->ApoderadoConfiguration|None:"""Return this bucket's configuration, or ``None`` when absent."""...
[docs]defsave(self,configuration:ApoderadoConfiguration)->None:"""Persist this bucket's configuration."""...
[docs]defdelete(self)->bool:"""Retire this bucket's configuration, returning whether it existed."""...
[docs]classApoderadoConfigurationRepositoryFactory(Protocol):"""Construct one bucket-bound apoderado configuration capability."""def__call__(self,*,bucket_id:str,settings:Settings)->ApoderadoConfigurationRepository:"""Return the capability routed to ``bucket_id`` and ``settings``."""...