Repository navigation
feat: materialize secrets as files with file sinks - #9
Conversation
golangci-lint 2.12.2 was built with Go 1.26 and refuses to lint a 1.27 module, so mise.toml pins 2.13.2 next to the toolchain. CI already reads the Go version from go.mod.
mockery's snakecase filename for RawReader would collide with the hand-written raw_reader_mock.go and overwrite MockRawClient on the next run.
A SIGINT during secret fetch or file materialization used to kill envctl before the deferred cleanup ran, leaking the 0700 run directory. runRun now traps signals for the whole command, and materializeFiles zeros every content buffer on exit instead of only on the success path.
|
Added end-to-end tests in One test-only race surfaced on the way: The repo has no CI job running |
|
CI is wired up and green: https://github.com/SentioLabs/envctl/actions/runs/33816135539
The lint job runs the whole module because the 96 pre-existing findings are fixed in this branch too, twelve behavior-neutral commits reviewed for output and state-transition parity in the TUI refactors. golangci-lint 2.13.2 is the current upstream release, so the pin stays. |
Some secrets are consumed as files, not environment variables: SAML keypairs and IdP metadata, TLS certs, kubeconfigs. Developers had been hand-copying them from Secrets Manager into a gitignored directory inside the repo, where coding agents and indexers still read them.
A source can now declare a
file:block.envctl runwrites it into a fresh 0700 directory under$TMPDIRwith mode 0600, exports the path throughpath_as, and removes the directory on every exit path, including a non-zero child exit and SIGINT.file.pathopts into a persistent location, refused when it sits unignored inside a git worktree.envctl cleanremoves persistent sinks. Content never reaches stdout in any command.Also moves the toolchain to Go 1.27.0 with a
mise.toml.Verify:
mise exec -- go test ./..., thenenvctl validateagainst a config with afile:source andenvctl run -- ls -l "$KEY_FILE".