aeat.application.user_profile._custody module

Application-owned custody operations for the profile secret store.

The config CLI calls this module for recovery-code minting, verification, rekey, and recovery. Storage primitives stay in aeat.adapters.persistence.storage; this layer resolves Settings, updates the active profile manifest when recovery is enrolled, and returns typed application result records.

Plaintext recovery words are returned only from mint_recovery_code(). They are never persisted by this module; the secret store keeps only wrapped recovery material. Verification failures from RecoveryVerificationError and related storage errors are rendered as a false verification result rather than leaking backend exception details.

class CustodyRecoveryEnrollment(**data)[source]

Bases: BaseModel

Result of minting or rotating the persisted recovery wrapper.

Parameters:
recovery_path: Path
mnemonic: str
rotated: bool
class CustodyRecoveryStatus(**data)[source]

Bases: BaseModel

Current recovery-wrapper status for the configured secret store.

Parameters:
  • recovery_path (Path)

  • recovery_enrolled (bool)

recovery_path: Path
recovery_enrolled: bool
class CustodyRecoveryVerification(**data)[source]

Bases: BaseModel

Result of checking an operator-supplied recovery mnemonic.

Parameters:
recovery_path: Path
verified: bool
class CustodyRekeyResult(**data)[source]

Bases: BaseModel

Result of rewrapping the master key under a new file-backend passphrase.

Parameters:
  • secret_store_dir (Path)

  • rekeyed (bool)

secret_store_dir: Path
rekeyed: bool
class CustodyRecoverResult(**data)[source]

Bases: BaseModel

Result of recovering the master key from the recovery wrapper.

Parameters:
  • recovery_path (Path)

  • secret_store_dir (Path)

  • recovered (bool)

recovery_path: Path
secret_store_dir: Path
recovered: bool
recovery_wrap_path(settings=None)[source]

Return the configured persisted recovery-wrapper path.

Return type:

Path

Parameters:

settings (Settings | None)

inspect_recovery_status(settings=None)[source]

Inspect whether the configured recovery wrapper exists and return a CustodyRecoveryStatus.

Return type:

CustodyRecoveryStatus

Parameters:

settings (Settings | None)

mint_recovery_code(settings=None)[source]

Mint a new recovery mnemonic and return a CustodyRecoveryEnrollment.

The mnemonic is returned exactly once. The plaintext words are not persisted; only the wrapped master key lands in the secret-store directory.

Return type:

CustodyRecoveryEnrollment

Parameters:

settings (Settings | None)

verify_recovery_code(*, mnemonic, settings=None)[source]

Verify mnemonic against the configured recovery wrapper and return a CustodyRecoveryVerification.

Return type:

CustodyRecoveryVerification

Parameters:
rekey_secret_store(*, new_passphrase, settings=None)[source]

Rewrap the current master key under new_passphrase and return a CustodyRekeyResult.

Return type:

CustodyRekeyResult

Parameters:
recover_secret_store(*, mnemonic, new_passphrase, settings=None)[source]

Recover the master key from mnemonic and return a CustodyRecoverResult.

Return type:

CustodyRecoverResult

Parameters:
recover_secret_store_with_callback(*, mnemonic, passphrase_callback, settings=None)[source]

Recover the master key using a caller-owned passphrase callback and return a CustodyRecoverResult.

Return type:

CustodyRecoverResult

Parameters: