Source code for cadrumo.application.user_profile.repository
"""Secure-object key construction for immutable filing-time profile snapshots."""from__future__importannotationsfrom...domain.user_profile.errorsimportUserProfileValidationError
[docs]defuser_profile_snapshot_object_key(profile_id:str,snapshot_id:str)->str:"""Return the secure-object key for one of a profile's filing snapshots."""trimmed_profile=profile_id.strip()trimmed_snapshot=snapshot_id.strip()ifnottrimmed_profile:raiseUserProfileValidationError(context={"field":"profile_id","blank":True})ifnottrimmed_snapshot:raiseUserProfileValidationError(context={"field":"snapshot_id","blank":True})returnf"user-profile-snapshot:{trimmed_profile}:{trimmed_snapshot}"