Repository navigation
feat: nook secret set, list, and unset - #6
Conversation
A static nook's files reach every viewer's browser, so they are readable by anyone who can open it. A service nook's run code never reaches a browser, and should not become readable just because someone was shared the nook. source is "editors" (owner and editors) by default, or "viewers" to opt in to the static behaviour. Parse writes the default out explicitly, so a pull or an export of a service nook states who can read it rather than leaving it implied. nookd enforces this on /_nook/source, pull, and remix.
A value is never an argument: argv lands in shell history and is visible in ps. It comes from a pipe, or from a prompt with the terminal's echo off through stty, which keeps the CLI's dependency list empty for the sake of one prompt. Where echo cannot be turned off the CLI says so instead of quietly showing it. list shows what nook.json declares against what is set and by whom, so the gap that stops a nook starting is the thing you see. No command prints a value.
|
Reviewed. The shape is right: the value never reaches argv, A piped value is truncated at the first newline. Echo stays off if the prompt is interrupted.
Nothing else. The reasoning on no MCP tool for this is right, and worth keeping in the docs when they land. |
…s here A piped value was read one line at a time, so a PEM key or a JSON credential stored its first line and reported success: the nook then fails at runtime with a value that looks set. Stdin is now read whole, with exactly one trailing newline removed, the one a shell or an editor adds. Ctrl+C at the prompt left the terminal with -echo, typing blind until stty echo. SIGINT is caught for the length of the prompt, restores, and exits 130. A name the server's regexp rejects is refused here instead of as a round trip to a 400. isSecretName stays looser on purpose, so "_FOO" is read as a misspelled key and named as one rather than taken for a nook. go test ./cmd/nook covers the pipe, since a stored value can never be read back.
|
All three fixed. Piped values are read whole, with exactly one trailing newline removed — the one a shell or editor adds — and everything else kept. You were right that this was the worst version of the bug: it reported success. Since a stored value can never be read back, there is nowhere downstream to observe this, so it is covered by a unit test instead: a 4-line PEM key round-trips intact, along with SIGINT is caught for the length of the prompt, restores echo, and exits 130. Names are checked against the server's regexp before the request. One deliberate difference from your suggestion: I left Noted on the MCP reasoning going in the docs — that lands with the SKILL.md changes in step 5, where the helper libraries are documented. |
The CLI half of step 2 of DESIGN.md §10b. Pairs with the nookd PR that stores them.
ps, so it comes from a pipe or a prompt and nothing else.stty, which keeps nook-cli's dependency list empty rather than pulling inx/termfor one prompt. Where echo cannot be turned off the CLI says so rather than quietly showing the value.listshows declared against set, so the gap that stops a nook from starting is the thing you see, with who set each one. No command prints a value, including--json.KEYis not mistaken for the nook's name, sonook secret set SLACK_TOKENworks inside a nook folder.No MCP tool for this, deliberately. The other eleven have one. A secret's value passing through an agent's tool call is the thing this feature exists to avoid, and an agent that needs it can tell the person the one command to run.
Part of ENG-24