Summary #
Prevent child subprocesses from inheriting the daemon's HTTP bearer token (GOOSEFOOT_API_KEY) while preserving all other operator-supplied environment variables (PATH, HOME, BEETSDIR, custom hook variables, etc.).
- Add
cmdstream.BaseEnviron(), which returnsos.Environ()withGOOSEFOOT_API_KEYfiltered out (case-insensitively on the variable name). - Build child environments in
cmdstream.RunfromBaseEnviron()sobeet import,beet import -t, and post-import hooks inGOOSEFOOT_HOOKS_DIRnever receiveGOOSEFOOT_API_KEY. - Set
cmd.Env = cmdstream.BaseEnviron()inCLIBeetsRunner.VersionsoGET /healthbeet versionchecks also excludeGOOSEFOOT_API_KEY.
Testing #
gofmt -l .go vet ./...go test -race -count=1 ./...