feat: durable refresh runs from a source to a staging target (auth M6c)
A refresh captures a new dump of the relation's source, then restores exactly that snapshot onto the relation's target through the existing restore path. - refresh_runs in SQLite, one active run per target, per-requester idempotency keys, a cap on concurrent runs and a TTL that only applies until the restore starts overwriting - the run and its capture job are created in one transaction; the run follows its own capture job, never the latest snapshot, and pins that snapshot until it ends - the restore is queued and linked in one guarded transaction; every step is safe to repeat after a crash; a background driver only reads the database - authorize_apply re-checks, in the transaction that allows the overwrite, that the relation is still usable, the requester is still active, the authorising grant still exists, the deadline has not passed and the target is not the source; otherwise the restore is cancelled, the run is blocked and the agent gets 409. Administrator restores are untouched - POST/GET/DELETE /api/v1/refresh-runs: confirmation names source, target and version; non-administrators never see the snapshot id, the requester or the database identity - audit refresh.* per run Tests drive the agent through the real Outpost endpoints and cover revocation at every stage; the access matrix gains a RunRow kind. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ mod catalog;
|
||||
mod gate;
|
||||
mod jobs;
|
||||
mod oidc;
|
||||
mod refresh;
|
||||
mod relations;
|
||||
mod orbit;
|
||||
mod restore;
|
||||
@@ -18,6 +19,10 @@ mod credentials_tests;
|
||||
mod access_tests;
|
||||
#[cfg(test)]
|
||||
mod export_tests;
|
||||
#[cfg(test)]
|
||||
mod refresh_tests;
|
||||
|
||||
pub use orbit::run_orbit_internal;
|
||||
pub use routes::router;
|
||||
pub(crate) use restore::artifact;
|
||||
pub(crate) use relations::identity_facts;
|
||||
|
||||
Reference in New Issue
Block a user