hyperhive/swarm-secret-client/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 676c45bc93 swarm: mint, publish and login-verify an agent's store identity at create
`swarm/agents/<agent>/bao-mtls` did not exist, and neither did any
per-agent identity at the secret store: `policy::agent_object_name`,
`render_agent` and `render_agent_with_queue` had been written and never
called outside their own tests. An agent's only "per-agent" secret today
is read under the HIVE's certificate, through a wide grant on
`swarm/agents/*` — so "per-agent" was presentational.

The swarm now mints the certificate, so no hive ever needs the capability
to mint one. `swarm-controller` is the service that does it: it already
logs in to the store, and its existing grant already covers exactly the
three objects written here (`create/update` on
`secret/data/swarm/agents/*`, `sys/policies/acl/hive-*` and
`auth/cert/certs/hive-*`). No new bao grant, and nothing co-located — a
cert-auth role pins its authority by value, per role, so the controller
issues from its own CA on its own host and pins that CA in the role it
writes. No existing role changes.

The mint node does not report success on a write. After publishing it
connects again, with the leaf it just issued and under the role it just
wrote, and reads the path back — so the policy, the role, the common name
and the leaf are exercised in production on every agent creation. A
certificate this code mints that the role this code writes will not accept
turns the job node red at creation time instead of surfacing later as an
agent container that cannot start.

`TriggerDeploy` gains an `after_any` edge on the mint, not `after_ok`: a
hive cannot pass down a certificate the swarm has not published, but a
host with no authority configured must still create agents exactly as it
does today.

The private key is generated in memory and never written to disk on the
controller — `SecretStore::connect_with_identity` takes the PEM the minter
is already holding, so nothing is written out purely to be logged in with.

Refs #4137
2026-09-18 15:05:24 +02:00
..
client.rs swarm: mint, publish and login-verify an agent's store identity at create 2026-09-18 15:05:24 +02:00
lib.rs swarm: mint, publish and login-verify an agent's store identity at create 2026-09-18 15:05:24 +02:00
matrix.rs matrix: remove the registration token 2026-09-15 19:58:10 +02:00
mtls.rs swarm: mint, publish and login-verify an agent's store identity at create 2026-09-18 15:05:24 +02:00
path.rs swarm: put the matrix registration token where the reader is granted 2026-09-12 19:46:04 +02:00
policy.rs Derive queue path from agent_client_path in render_agent_with_queue 2026-09-15 23:03:58 +02:00
queue.rs swarm-secret-client: say why the queue credential's client id is required 2026-09-12 11:22:33 +02:00