Watch
0
0
Fork
You've already forked hyperhive
0

swarmctl bao init: save bao's raw output before parsing, and accept null key lists

This commit is contained in:
atlas 2026-11-24 15:35:57 +01:00
commit 870a0a6697

View file

@ -75,9 +75,11 @@ These run the `bao` CLI, so they reach the store over HTTPS wherever it runs;
the CLI's own `BAO_ADDR`, `BAO_CACERT` and `BAO_CLIENT_*` say where. The root
token is handed to each `bao` child in its own `BAO_TOKEN` environment, which
is readable only by root through `/proc`; it is never in an argument list,
this process's environment or a file, and error text from `bao` has it
replaced before it is shown. `init` prints the keys and the token to stdout
once and keeps none; `grant-bootstrap` reads the token from a hidden prompt,
this process's environment or an error message, and error text from `bao` has
it replaced before it is shown. `init` prints the keys and the token to stdout
once, and saves `bao`'s raw output to a 0600 file first (see
`docs/1-getting-started/setup.md`), so that a parse failure leaves the keys on
disk; `grant-bootstrap` reads the token from a hidden prompt,
or from stdin when that is not a terminal. Both wipe the strings from memory
when done, on a best-effort basis: the JSON parser and the pipe buffers touch
the heap on the way.