Source code for cadrumo.adapters.persistence.profile._filing_runtime
"""Runtime-backed repository helpers shared by the filing persistence adapters.Shared private helpers for:mod:`~adapters.persistence.profile.filing_drafts`: a bucket-id resolver anda runtime factory thatreturns a:class:`~adapters.persistence.storage.sql.secure_objects.SecureObjectRepository` bound tothe active profile bucket. Both live in the persistence adapter alongside therepositories they serve, so the secure-object coupling is a same-layer``adapters -> adapters.persistence.storage`` import rather than a``domain -> adapters`` violation.See Also: :func:`~core.bucket_pointer.resolve_repository_bucket_id` Shared resolver for explicit-or-active profile bucket ids. :func:`~adapters.persistence.storage.runtime_repository.secure_object_repository_for_bucket` Runtime storage factory used after the filing bucket id is resolved. :mod:`~adapters.persistence.profile.filing_drafts` Draft repository consumer of these filing runtime helpers."""from__future__importannotationsfrom....core.bucket_pointerimportresolve_repository_bucket_idfrom....domain.filing.errorsimportModeloDraftError
[docs]defresolve_filing_repository_bucket_id(bucket_id:str|None)->str:"""Return an explicit or active profile bucket id for filing repositories."""returnresolve_repository_bucket_id(bucket_id,error_type=ModeloDraftError)