Skip to content

feat(tvc): flexible --operator-seed source (env/stdin/file)#173

Open
prasanna-anchorage wants to merge 1 commit into
tkhq:mainfrom
anchorageoss:feat/operator-seed-source
Open

feat(tvc): flexible --operator-seed source (env/stdin/file)#173
prasanna-anchorage wants to merge 1 commit into
tkhq:mainfrom
anchorageoss:feat/operator-seed-source

Conversation

@prasanna-anchorage

Copy link
Copy Markdown

What

tvc deploy approve (and tvc keys re-encrypt-share) currently take --operator-seed <PATH> — the operator master seed must be written to a file on disk. This makes --operator-seed (env TVC_OPERATOR_SEED) accept a source spec so the seed needn't touch disk:

  • env:NAME — read the hex seed from environment variable NAME
  • stdin (or -) — read the hex seed from stdin
  • file://<path> — read from a file
  • bare <path> — read from a file (back-compatible with today's behavior)

Unset still falls back to the logged-in org operator key. Resolution happens in one place (operator_key::load_operator_pair) via a small read_seed_source helper.

Why

For CI/automation, requiring a file means materializing the operator seed onto disk (then trying to scrub it). Passing it via stdin keeps the secret off disk and out of argv/shell history; env: is convenient where a file is undesirable. This is a small quality-of-life + secret-hygiene improvement.

Notes

  • No new dependenciesstd only (from_hex_seed already existed on LocalPair).
  • Back-compatible: a bare path is still treated as a seed file.
  • cargo fmt + cargo clippy -p tvc clean; cargo check -p tvc passes.
  • Caveat: use stdin with non-interactive approval (--dangerous-skip-interactive), since stdin is consumed for the seed.

… file path

`--operator-seed` (env TVC_OPERATOR_SEED) now accepts a SOURCE spec so the
operator master seed needn't be written to disk:
  - `env:NAME`            read the hex seed from an environment variable
  - `stdin` / `-`         read the hex seed from stdin
  - `file://<path>` / bare <path>   read from a file (back-compatible)
Falls back to the logged-in org operator key when unset. Applied to both
`tvc deploy approve` and `tvc keys re-encrypt-share`. std-only, no new deps.

Motivation: CI/automation can pass the seed via stdin or an env var instead of
writing a 0600 temp file, keeping the secret off disk (and out of argv/shell
history when piped via stdin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant