cadrumo.adapters.persistence.storage.custody.records module

Strict, current-format records for password-wrapped profile custody.

PROFILE_CUSTODY_ENVELOPE_FILENAME: Final

The password envelope’s name inside a capsule’s custody/ directory. Named beside its size bound and its sentinel/recovery siblings, which already carry one; it was the last capsule member whose filename was a literal repeated at each publication and read site.

PROFILE_CUSTODY_ENVELOPE_MAX_BYTES: Final

all fixed-width fields, a present predecessor digest, and the ten-digit maximum password generation.

Type:

Largest possible canonical v1 envelope

class ProfileCustodyKdfParameters(**data)[source]

Bases: BaseModel

The finite Argon2id parameter grid accepted by custody v1.

Parameters:

data (Any)

algorithm: KdfAlgorithm
version: KdfVersion
memory_mib: KdfMemoryMib
iterations: KdfIterations
parallelism: KdfParallelism
salt_b64: str
output_bytes: KdfOutputBytes
class ProfileCustodyWrappedDek(**data)[source]

Bases: BaseModel

Authenticated AES-GCM payload carrying exactly one 32-byte DEK.

Parameters:

data (Any)

nonce_b64: str
ciphertext_b64: str
tag_b64: str
class ProfileCustodyEnvelope(**data)[source]

Bases: _ProfileCustodyEnvelopePayload, CustodyDigestModel

Immutable v1 authority for one profile’s normal password unlock.

Parameters:

self_digest (str)

self_digest: str
classmethod create(*, profile_id, password_generation, dek_epoch, kdf, wrapped_dek, previous_envelope_digest=None)[source]

Build a validated envelope with its canonical self-digest.

Return type:

ProfileCustodyEnvelope

Parameters:
parse_profile_custody_envelope(value)[source]

Parse one canonical strict UTF-8 current-format custody envelope.

Return type:

ProfileCustodyEnvelope

Parameters:

value (bytes)