Skip to content

docs/argus-hub.md: key-rotation instructions are wrong #309

Description

@jcsalterego

Found while auditing argus-hub's README against this doc (Agent-Deployment-Co/argus-hub#35).

docs/argus-hub.md:109-111 says:

To rotate a key, disable or remove the old key in the Hub database, then restart Hub. If no enabled key remains, Hub generates a new one on startup.

That's not how Hub's bootstrap actually works. It only checks whether the api_keys table is empty:

const keyRow = await get(db, "SELECT key_hash FROM api_keys LIMIT 1");
if (!keyRow) { /* mint + print a new key */ }

src/store/hub-store.ts:618-624 in argus-hub

A disabled-but-present row (is_enabled = 0) does not count as "no enabled key remains" in the code's actual logic — the row is still there, so no new key is minted. Following the doc's instructions (disable the old key, restart) leaves an operator with a Hub that rejects every upload and prints nothing, with no obvious way to recover short of manually deleting the row.

argus-hub's own README (L96-100, prior to this fix) already had the correct behavior documented: "if the table is empty." Suggest updating this doc to match — rotation requires deleting the old row, not just disabling it, for a new key to be generated on restart.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions