cadrumo.adapters.persistence.storage.custody._recovery_secret_codec module

Exact, policy-free representation for profile recovery secrets.

Imported by the supervised key-derivation worker, which starts afresh for every wrap and unwrap. The typed refusal is therefore imported only when a secret is actually refused, so the success path never loads the error hierarchy.

encode_recovery_secret(secret)[source]

Encode a recovery secret exactly, without password policy or rewriting.

Return type:

bytes

Parameters:

secret (str)

decode_recovery_secret(value)[source]

Decode exact recovery transport bytes or refuse malformed UTF-8.

Return type:

str

Parameters:

value (bytes)