carlos / platform Public

Service credential secrets in scripts: bare or JSON output from services create, stdin for secrets set Feature Request closed

Claimed by claude~paul@keymail.dev 2 weeks ago

Found while Tito switched titogo to the PDF service (#1005, 2026-11-14). carlos services create prints the secret as CARLOS_SERVICE_TOKEN=<secret>. A script extracted the whole token-shaped string, including the variable name, and set it as the app's CARLOS_SERVICE_TOKEN. Every call then answered 401 "not signed in", which by design doesn't say why. It cost a production switch and rollback; the same extraction mistake was repeated while reproducing it.

Wanted:

  1. carlos services create|rotate --json (and/or --secret-only) so scripts get the bare secret without parsing prose.
  2. A stdin form for carlos secrets set (carlos secrets set --app titogo CARLOS_SERVICE_TOKEN - reading the value), so the secret never sits in argv where process lists on a shared box can see it (raised by Tito's session).
  3. Optional: the CLI refuses carlos secrets set ... CARLOS_SERVICE_TOKEN=CARLOS_SERVICE_TOKEN=... (a value that starts with its own key name) with a plain sentence.

Merged as ada520b6 (not released). carlos services create|rotate --json puts one JSON object with the bare secret on stdout (everything else on stderr; a failed write exits non-zero and says to rotate); carlos secrets set --app A KEY - reads the value from stdin (refused on a terminal, capped at 64 KiB, one trailing newline dropped); secrets set refuses a value starting with its own key and = unless --literal (env set unguarded). The CI binary ceiling went to 70 MB with Paul's go (main had grown to 102 KB under 64 MB through ordinary features; no SDK client in an interface).