From 1e8eae1f3de765fcd8163716de6e5fe5aab5a034 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 15 Oct 2026 09:33:28 +0200 Subject: feat(hub): one account, several linked nodes An account links up to MAX_NODES_PER_ACCOUNT node keys (node_keys table) instead of the one users.pk_node_ed25519; the migration carries each account's key over and the downgrade keeps the last one linked. /v1/nodes/auth accepts any linked key, and its token names the key that won it (nk). PUT /me/node_key adds a key, idempotently, 409 past the limit; DELETE /me/node_key names the key: a browser session any of its own, a node only its own. Unlinking a key closes that node's socket and refuses its tokens at once, on REST and on the socket; the account's other nodes are untouched. /pubkeys no longer gives a node key to other accounts, and gives the caller its last linked one, which installed desktop apps read. The node reports waiting_for_node_key while its key is unlinked and signs in again as soon as the hub says so, so a key linked again is back within seconds; unlinking itself signs in first to hold a token naming its key. Profile -> Linked nodes lists each node (connected, last seen, IP, linked since, This machine in the desktop app) with Copy and Unlink, and adds a key by hand. The Node page banner, Create group and the desktop app add this machine's key instead of replacing another's. Messages that pointed at Settings -> Link Node point at Profile -> Linked nodes. Co-Authored-By: Claude Opus 5.5 --- docs/MESHBAY_HTTP_API.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/MESHBAY_HTTP_API.md') diff --git a/docs/MESHBAY_HTTP_API.md b/docs/MESHBAY_HTTP_API.md index be4e7e2..70bcefe 100644 --- a/docs/MESHBAY_HTTP_API.md +++ b/docs/MESHBAY_HTTP_API.md @@ -61,10 +61,11 @@ hub also serves the web application at `/` and `/app/`, which are not listed. | GET | `/v1/users/me/preferences` | user or node | The account's stored interface preferences. | | PUT | `/v1/users/me/preferences/{key:path}` | user | Store one interface preference. | | DELETE | `/v1/users/me/preferences/{key:path}` | user | Remove one interface preference. | -| PUT | `/v1/users/me/node_key` | user | Link a node daemon's Ed25519 public key to the operator's account. | -| DELETE | `/v1/users/me/node_key` | user or node | Remove the linked node key from the operator's account. | +| GET | `/v1/users/me/node_keys` | user | The node keys linked to your account, oldest first, with what the hub saw of each node. | +| PUT | `/v1/users/me/node_key` | user | Link a node daemon's Ed25519 public key to your account, alongside any already linked. | +| DELETE | `/v1/users/me/node_key` | user or node | Unlink one node key from your account. | | DELETE | `/v1/users/me` | user | Erase your own account. | -| GET | `/v1/users/{username}/pubkeys` | user or node | Resolve a username to its account id, and its node's linking key. | +| GET | `/v1/users/{username}/pubkeys` | user or node | Resolve a username to its account id. | ### Nodes -- cgit v1.2.3