Skip to main content

Module cross_account

Module cross_account 

Source
Expand description

Cross-account confirmation cache.

§Purpose

When a cross-account copy requires an explicit large-file confirmation, the frontend calls cross_account_confirm to obtain a one-time token that it then passes back via object_copy as confirmed_token.

The cache holds ConfirmationRecords keyed by UUID token string. Each record is scoped to a specific (source_bucket, source_key, dest_bucket, dest_key, profile) tuple and expires after 5 minutes. Tokens are single-use: consume atomically checks the scope and marks the record consumed so it cannot be replayed.

§OCP

ConfirmScope and ConfirmationRecord are additive — new fields can be added with #[serde(default)] without breaking existing confirmation flows. ConfirmationCache is reusable for any “explicit confirmation needed” pattern (storage-class destructive ops, metadata overwrites, …).

Structs§

ConfirmScope
The scope a confirmation token is bound to.
ConfirmationCache
Thread-safe in-memory cache of pending confirmation tokens.
ConfirmationCacheHandle
Newtype around Arc<ConfirmationCache> used as Tauri managed state.
ConfirmationRecord 🔒
One pending confirmation stored in the cache.

Constants§

TOKEN_TTL 🔒
Time-to-live for confirmation tokens.