Repository navigation
chore(volumes): guard the statement verification keys in release builds - #230
Conversation
…n file The key table and the production host decide what a released CLI trusts, so they get a file of their own that a code-owner rule can cover without also covering the verification logic in keys.go.
The statement verification keys, the build switch for the development key override and the checks that guard them decide which keys a released CLI trusts. Name their package in CODEOWNERS so it keeps a maintainer's review even if the default owner changes; a directory rule also survives a file rename.
…y tag Only a build with the volumesdevkeys tag reads the statement key override, and nothing stopped a later change from adding the tag to GoReleaser, the release workflow or make install and build-all. Check all three, so go test, which CI and the release job run before GoReleaser, fails first.
A release with no production verification keys refuses every statement from the production API, so the volumes commands must stay hidden until a release ships those keys. The production key set is empty until its key is published; this test makes unhiding the commands before then fail in CI and in the release job.
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include
|
There was a problem hiding this comment.
🟡 Changes recommended
The release guard misses target-specific GOFLAGS exports and bare export directives, allowing development keys into release binaries without detection; both forms need detection and regression coverage.
1 open issue
What changed in this PR
Adds safeguards around Shared Volumes statement verification to keep development-key overrides out of distributed CLI builds and protect changes to trusted keys.
Changes:
- Moves the production host and key table into a dedicated file, retaining the empty production key set.
- Adds release-build checks and a test requiring production keys before volumes commands become visible.
- Adds explicit maintainer ownership for the keypair package.
| File | Description |
|---|---|
internal/volumes/keypair/verificationkeys.go |
Houses the production host and trusted-key table. |
internal/volumes/keypair/releasebuild_test.go |
Checks GoReleaser, release workflow, and Makefile build settings. |
internal/volumes/keypair/release_test.go |
Requires production keys before volumes commands become visible. |
internal/volumes/keypair/keys.go |
Removes definitions relocated to verificationkeys.go. |
internal/volumes/keypair/export_test.go |
Exposes the production key count to external-package tests. |
internal/cmd/serverless/volumes.go |
Updates a comment to reference the visibility guard. |
.github/CODEOWNERS |
Assigns explicit maintainer ownership to the keypair directory. |
Review effort: Balanced
A recipe that reads GOFLAGS from its environment hides a tags flag from make -n. The Makefile check only saw a top-level export of GOFLAGS, so a target-specific export (install: export GOFLAGS = ...), an override export or a bare export, which exports every variable, passed it.
danmrichards
left a comment
There was a problem hiding this comment.
From Dan Richards's agent (Claude), not Dan Richards.
Added a few non-blocking comments. LGTM ✅

Release builds already never read
RUNWARE_VOLUMES_STATEMENT_KEY: the override is compiled in only with thevolumesdevkeystag, and the only binaries built with it are the local ones frommake buildandmake run. This PR adds the guards that keep it that way and pins who can change the trusted keys.The key table and the production host move from
keys.gointoverificationkeys.go, and CODEOWNERS now namesinternal/volumes/keypair/, so a change to the keys, the dev-key switch or the tests that guard the release build keeps a maintainer's review even if the default owner changes. A directory rule also survives a file rename.New tests fail if
.goreleaser.yaml(builds, overrides, flags, env), the release workflow ormake install/make build-allwould build with the development tag or setGOFLAGS. They read the GoReleaser config as YAML, the release workflow as plain text for the tag andGOFLAGS, and the Makefile through its expandedmake -noutput, without parsing shell, so git's--tagsand similar edits do not trip them. CI runs them, and the release job runs them before GoReleaser.The production key set stays empty until that key is published. A release check would block every CLI release until then, so instead
TestVisibleVolumesNeedProductionKeysfails as soon as the volumes commands are unhidden while the set is empty, and a release without keys refuses every statement at runtime. The follow-up adds the key inverificationkeys.goafter checking the upload host rule its comment points to.Written with Claude Code (Claude Opus 5.5).