Watch
0
0
Fork
You've already forked hyperhive
0

agent permissions: a destroyed agent's key goes with it

Declaring an agent Destroyed now deletes its `agent-permissions` key,
next to the queue-credential revoke and with the same failure handling:
logged at error, the destroy goes ahead, and declaring it destroyed
again re-runs it. Agent names are reusable after a destroy, and a create
left on the default stores no key, so the old key handed a new agent of
the same name the destroyed agent's grant (argus on #5293).

Also: migrate.rs's create-time-setup note named ruth's tool-group seed
in `ensure_root_agent`, which this PR deletes; it now says she holds the
code-constant default when the swarm sets nothing.

Part of #5170.
This commit is contained in:
atlas 2026-10-15 10:27:35 +02:00 • committed by mara
commit 4f9e9bd680
3 changed files with 73 additions and 7 deletions

View file

@ -1410,11 +1410,12 @@ async fn set_agent_state(
// After the declaration and never before it: the write above is the
// destroy order, and until it lands the agent is not being torn down, so
// its credential has to keep working. Sequenced rather than spawned so
// the revocation attempt is finished — and its outcome logged — by the
// time the operator's call returns.
// its credential and permissions have to keep working. Sequenced rather
// than spawned so both attempts are finished — and their outcomes
// logged — by the time the operator's call returns.
if revokes_queue_credential(req.state) {
revoke_or_complain(&hive, &agent).await;
agent_permissions::clear_on_destroy(&state, &hive, &agent).await;
}
Ok(Json(render(&declaration)))
}