aeat.adapters.outbound.storage._records module

Pydantic records and enums for the outbound storage abstraction.

Provider records anchor the storage boundary:

class ProviderKind(*values)[source]

Bases: StrEnum

Closed storage backend selector for adapters.outbound.storage.get_storage_provider().

LOCAL_FILESYSTEM
GOOGLE_DRIVE
class RemoteMirrorIssueKind(*values)[source]

Bases: StrEnum

Remote ciphertext mirror degradation classes carried by RemoteMirrorIssue.

PARTIAL_UPLOAD
PARTIAL_DOWNLOAD
STALE_MIRROR
REVISION_CONFLICT
class ProviderObjectMetadata(**data)[source]

Bases: BaseModel

Per-object metadata returned by storage-provider operations.

Returned by adapters.outbound.storage.StorageProvider methods: adapters.outbound.storage.StorageProvider.put(), adapters.outbound.storage.StorageProvider.get(), and adapters.outbound.storage.StorageProvider.iter_objects(). provider_object_id is the backend-native identifier (a filesystem path for the local provider, a Drive fileId for the Google Drive provider). The coordinator threads it through subsequent get/delete/patch calls without re-resolving by name.

Parameters:
  • namespace (str)

  • object_key_hmac (str)

  • provider_object_id (str)

  • byte_length (int)

  • content_hash (str)

  • written_at (datetime)

namespace: str
object_key_hmac: str
provider_object_id: str
byte_length: int
content_hash: str
written_at: datetime
class ProviderProbeReport(**data)[source]

Bases: BaseModel

Health-check result returned by storage-provider probes.

Returned by adapters.outbound.storage.StorageProvider.probe(). reachable is True iff the backend endpoint responds at all. writable is True iff a sentinel payload write/delete succeeded; inherently False when the probe runs in read-only mode. root_folder_present is non-None only when the backend supports the notion of an operator-configured root folder (currently Google Drive).

Parameters:
provider_kind: ProviderKind
reachable: bool
writable: bool
read_only: bool
root_folder_present: bool | None
detail: str
class RemoteMirrorObjectManifest(**data)[source]

Bases: BaseModel

One ciphertext object entry recorded in a RemoteMirrorNamespaceManifest.

Parameters:
  • namespace (str)

  • object_key_hmac (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=64), MaxLen(max_length=64)])])

  • classification (str)

  • schema_version (int)

  • byte_length (int)

  • ciphertext_hash (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=64), MaxLen(max_length=64)])])

  • storage_revision_id (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=64), MaxLen(max_length=64)])] | None)

  • previous_storage_revision_id (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=64), MaxLen(max_length=64)])] | None)

  • revision_ancestor_ids (tuple[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=64), MaxLen(max_length=64)])], ...])

  • row_written_at (datetime)

  • revision_written_at (datetime | None)

namespace: str
object_key_hmac: _ObjectKeyHmac
classification: str
schema_version: int
byte_length: int
ciphertext_hash: _CiphertextHash
storage_revision_id: _StorageRevisionId | None
previous_storage_revision_id: _StorageRevisionId | None
revision_ancestor_ids: tuple[_StorageRevisionId, ...]
row_written_at: datetime
revision_written_at: datetime | None
class RemoteMirrorNamespaceManifest(**data)[source]

Bases: BaseModel

Manifest persisted beside remote ciphertext objects for one namespace.

Built by adapters.outbound.storage.build_remote_mirror_namespace_manifest() and persisted by adapters.outbound.storage.put_remote_mirror_namespace_manifest().

Parameters:
  • manifest_schema_version (int)

  • namespace (str)

  • object_count (int)

  • latest_revision_id (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=64), MaxLen(max_length=64)])] | None)

  • latest_revision_written_at (datetime | None)

  • objects (tuple[RemoteMirrorObjectManifest, ...])

manifest_schema_version: int
namespace: str
object_count: int
latest_revision_id: _StorageRevisionId | None
latest_revision_written_at: datetime | None
objects: tuple[RemoteMirrorObjectManifest, ...]
class RemoteMirrorIssue(**data)[source]

Bases: BaseModel

One detected remote mirror degradation in a RemoteMirrorInspection.

Parameters:
  • kind (RemoteMirrorIssueKind)

  • namespace (str)

  • object_key_hmac (Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=64), MaxLen(max_length=64)])] | None)

  • detail (str)

kind: RemoteMirrorIssueKind
namespace: str
object_key_hmac: _ObjectKeyHmac | None
detail: str
class RemoteMirrorInspection(**data)[source]

Bases: BaseModel

Typed result returned by remote mirror comparison and inspection helpers.

Parameters:
namespace: str
issues: tuple[RemoteMirrorIssue, ...]
property ok: bool