feat(tvc): flexible --operator-seed source (env/stdin/file)#173
Open
prasanna-anchorage wants to merge 1 commit into
Open
feat(tvc): flexible --operator-seed source (env/stdin/file)#173prasanna-anchorage wants to merge 1 commit into
prasanna-anchorage wants to merge 1 commit into
Conversation
… 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tvc deploy approve(andtvc 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(envTVC_OPERATOR_SEED) accept a source spec so the seed needn't touch disk:env:NAME— read the hex seed from environment variableNAMEstdin(or-) — read the hex seed from stdinfile://<path>— read from a file<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 smallread_seed_sourcehelper.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
stdonly (from_hex_seedalready existed onLocalPair).cargo fmt+cargo clippy -p tvcclean;cargo check -p tvcpasses.stdinwith non-interactive approval (--dangerous-skip-interactive), since stdin is consumed for the seed.