Repository navigation
chore: sign with github.com/coder/gpgkms instead of scripts/gpgkms - #32308
Merged
Merged
Conversation
Replaces scripts/gpgkms with the shared github.com/coder/gpgkms module (v0.1.2), pinned as a go.mod tool dependency. scripts/gpgkms.sh supplies the release key's OpenPGP identity, which the module takes as flags; the derived public key is byte-identical to the one scripts/gpgkms produced.
go tool is how the repo runs its other go.mod tools; it caches the build and needs no temporary directory.
Collaborator
Author
|
@codex review |
Collaborator
Author
|
@codex security-review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Testing
|
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rowansmithau
approved these changes
Nov 17, 2026
kylecarbs
approved these changes
Nov 17, 2026
deansheather
had a problem deploying
to
docs-preview
November 18, 2026 04:37 — with
GitHub Actions
Failure
This branch had an error being deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replaces
scripts/gpgkmswithgithub.com/coder/gpgkmsv0.2.0, the same code extracted into a shared module (terraform-provider-coder already signs its releases with it). v0.2.0 also rejects keys that aren't HSM-backed (gpg-releaseisHSM, and the check readsprotectionLevelfrom the existingGetPublicKeycall, so no new IAM is needed), limits each KMS request to a minute, and writes-outatomically.go.mod: gpgkms is atooldependency, so the version is pinned ingo.mod/go.sumand Dependabot keeps it current. This bumps go-crypto 1.4.1 → 1.5.2, google.golang.org/api 0.308.0 → 0.311.0 and circl 1.6.3 → 1.6.5, plus a few indirect dependencies. go-crypto is now only indirect: nothing else in coder/coder imports it.scripts/gpgkms.sh(new): runs it withgo tool(likescripts/format_go_file.shdoes for gofumpt and gci), passing the release key's OpenPGP identity (name, email, creation time, 4-year lifetime). The library takes these as flags instead of hardcoding them, so they now live in one place.-fingerprint 0F685EFE0AE5A8182A473DD86E3A8E5613707520, so signing andpublic-keyfail if the KMS key or creation time ever change. That's the fingerprint every current main build prints (e.g. run 44031030839), and I recomputed it from the KMS public key and the creation time alone, without signing anything. The fingerprint doesn't cover the user ID or lifetime; the equivalence check below does.scripts/sign_with_gpg.shand the "Print GPG KMS public key" step inbuild.yamlcall the wrapper instead of./scripts/gpgkms. Signatures stay armored.v2.ascfiles, as before.scripts/gpgkms/is deleted.Same key, same signatures
The OpenPGP key's fingerprint depends on these exact inputs, so I checked that nothing changed. With a local RSA-4096 key standing in for KMS, the deleted
newEntity/writePublicKey/signproduce the same output as the gpgkms CLI with the flags read out ofscripts/gpgkms.sh:-prependis armored the same way and has the same length (only the timestamp differs). Both the prepended signature and the KMS signature verify in both outputs.(The byte-for-byte comparison runs without
-fingerprint, since the test key is random.)gpgkms also has its own compatibility test against this identity (
compat_test.go).Other checks:
Not run here: real signing through Cloud KMS. The first main build after merging prints the public key in the job summary; it should be identical to the one printed by current main builds.
AI disclosure: this PR was written by an AI coding agent (Xum) at my direction, and the agent ran the verification above. It stays a draft until I've reviewed it.