cadrumo.application.auth.diagnostics_ports module

Application-owned persistence contract for encrypted auth diagnostics.

The auth diagnostic use case only needs decrypted payload bytes. This narrow port keeps secure-object namespaces, repository construction, and storage failures in the persistence adapter while giving application callers a stable capability contract.

class AuthDiagnosticPersistenceRecord(**data)[source]

Bases: BaseModel

One decrypted auth-diagnostic payload supplied by persistence.

Parameters:

data (Any)

payload: bytes
exception AuthDiagnosticPersistenceError(operation)[source]

Bases: CadrumoError

A persistence operation for auth diagnostics failed at the adapter boundary.

Parameters:

operation (str)

Return type:

None

code
class AuthDiagnosticPersistencePort(*args, **kwargs)[source]

Bases: Protocol

Read and update encrypted auth-diagnostic payloads for the active profile.

list_records()[source]

Return every readable diagnostic payload for the active profile.

Return type:

tuple[AuthDiagnosticPersistenceRecord, ...]

load_record(diagnostic_id)[source]

Return one diagnostic payload, or None when it is absent.

Return type:

AuthDiagnosticPersistenceRecord | None

Parameters:

diagnostic_id (str)

save_record(diagnostic_id, payload, *, written_at)[source]

Persist one diagnostic payload for the active profile.

Return type:

None

Parameters: