Watch
0
0
Fork
You've already forked hyperhive
0

swarm: merge a re-create into the stored agent permissions instead of overwriting them

This commit is contained in:
atlas 2026-10-27 11:48:54 +01:00 • committed by mara
commit ae8b2d39ec

View file

@ -314,10 +314,12 @@ none. swarm-controller logs every refused `PUT` or `DELETE` on that route at `wa
**Internet flag** — the record also carries `unrestricted_internet`, a
boolean that isn't a `Permission`. An absent value means on, so every agent
that existed before the field keeps the open access it had. `POST /api/agents`
always writes the record with an explicit value, `false` unless the request
names it. A `PUT` that leaves the field out and a `DELETE` (`swarmctl agent
permissions clear`) keep the stored value; a `DELETE` on an agent that has one
rewrites the record to just that value. Read it with
writes `false` for an agent that has no record, unless the request names a
value. Over an existing record (a re-create) it keeps the stored list and flag,
an absent flag included, and a value in the request wins. A `PUT` that leaves
the field out and a `DELETE` (`swarmctl agent permissions clear`) also keep the
stored value; a `DELETE` on an agent that has one rewrites the record to just
that value. Read it with
`swarm_queue_client::agent_permissions::unrestricted`. Nothing acts on it yet.
**How a change applies** —