Skip to main content

Module agent_seats

Module agent_seats 

Source
Expand description

Agents set_seat (POST /api/v1/agent/seats): an agent, host or container, sets or clears the seats of agents on this machine, several in one call (a whole roster). A seat is an agent’s role, who it reports to and what it owns (backend::agent_seat); the operator’s window sets one with agent.setSeat (agent_handlers/seat.rs), and an agent does it here.

The caller is the agent its token names; a request without one is refused, so a change is never attributed to the operator. The checks are the window’s (roles, lengths, leads that are agents here, no cycle), applied to the whole call at once: it is written all together or not at all. Each change, and each refused attempt, is recorded in the audit log under the calling agent’s slug and in the identity log with its UID.

Structs§

Actor 🔒
The agent making the request.
Refusal 🔒
SeatEntry 🔒
SetSeatsRequest 🔒

Constants§

AUDIT_ACTION 🔒
The audit entry’s action for a change.
MAX_SEATS_PER_CALL 🔒
The most seats one call changes: a roster, not a sweep.

Functions§

actor_of 🔒
apply 🔒
Plan, then write all of changes under the seat lock.
audit 🔒
changes_of 🔒
The changes req asks for, with every agent and lead named by id, and the leads on other machines among them.
changes_of_with 🔒
handle_agent_seats 🔒
known_remote_agents 🔒
The agents on other machines this one sees on the LAN, as Name@host: the leads a seat may name besides this machine’s own agents.
refuse 🔒
remote_agents_on 🔒
peers (host, agent names) as Name@host, without the ones on own_host: another channel on this machine shares its agents, which are named by their local id, and Name@host would only be a second spelling of a local agent that the self-lead and cycle checks do not see.
remote_lead 🔒
The lead named (agent@host, any case) as the LAN lists it, else a refusal that lists what is known.
run 🔒
run_as 🔒
run_remote 🔒
set_seat for an agent on another machine (remote_ops::agent_ops): the same checks and write a local call has, recorded under who (slug@machine).
summary_of 🔒
What a change did, for the audit line and the answer.
uid_of 🔒
The uid of the agent named (an id or a slug) on this machine.