Watch
0
0
Fork
You've already forked hyperhive
0

swarm UI: fetch linked accounts only for the opened agent

The detail panel makes one request for the agent it shows,
GET /api/hives/{hive}/agents/{agent}/linked-accounts, which returns every
matrix, forge and github account of that agent as names and hosts. The
all-agents route and the table's matrix-column rows are removed, so the
table makes no linked-accounts request. The panel stays keyed by
hive/agent. The bao grant is unchanged.

Refs #4855
This commit is contained in:
atlas 2026-10-02 21:20:40 +02:00
commit 9224c0bd15
5 changed files with 78 additions and 195 deletions

View file

@ -26,10 +26,9 @@ into the swarm secret store through swarm-controller. All three are blind
set/update actions: no route hands a token back.
The agent's detail panel lists its linked accounts under **accounts**, one row
per account: kind, name and host. The table view's matrix column lists the
matrix rows. The page fills both from one request,
`GET /api/agents/linked-accounts`, which returns every agent's accounts as
names and hosts, grouped by hive and agent, and never a credential.
per account: kind, name and host. Opening an agent makes one request,
`GET /api/hives/{hive}/agents/{agent}/linked-accounts`, which returns every
account of that agent as names and hosts and never a credential.
| kind | one row per | name | host |
| ------- | ------------------------------------------- | ----------- | ------------------------ |
@ -38,8 +37,8 @@ names and hosts, grouped by hive and agent, and never a credential.
| github | `swarm/agents/<agent>/github-token`, if any | `github` | `github.com` |
The matrix `main` row is the agent's own account, which the swarm mints;
it carries an **own account** badge. The lists refresh when a link dialog
closes.
it carries an **own account** badge. The panel requests the list again when
a link dialog closes.
- **link a matrix account** — `PUT /api/hives/{hive}/agents/{agent}/matrix-accounts/{account}`,
either a pasted bearer token or a user id + password that