feat: wire GPG signing handler into CLI builtin plugins#2675
Conversation
|
Warning Review limit reached
More reviews will be available in 42 minutes and 15 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds GPG/OpenPGP signing support to the OCM CLI: it updates Go module dependencies, implements and registers a GPG signing plugin, adds an end-to-end integration test exercising sign/verify flows, and provides a user-facing tutorial documenting usage and best practices. ChangesGPG Signing Plugin Integration for OCM CLI
Sequence Diagram(s)sequenceDiagram
participant CLI_Init as CLI Init
participant Builtin as builtin.Register
participant GPG_Reg as gpg.Register
participant Handler as handler.New
participant Registry as SigningRegistry
CLI_Init->>Builtin: call builtin.Register()
Builtin->>GPG_Reg: call gpg.Register(signingRegistry, config)
GPG_Reg->>Handler: handler.New(nil)
GPG_Reg->>Registry: RegisterInternalComponentSignatureHandler(handler)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for ocm-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Registers the GPG/OpenPGP signing handler (from bindings/go/gpg, merged in open-component-model#2560) as a built-in CLI plugin alongside RSA and Sigstore. - cli/internal/plugin/builtin/gpg/register.go: new registration shim - cli/internal/plugin/builtin/builtin.go: register GPG plugin at startup - cli/go.mod: add direct dep on bindings/go/gpg - cli/integration/signing_gpg_integration_test.go: CLI-level round-trip test covering happy path, dry-run, and wrong-key verification failure - website/content/docs/tutorials/signing/gpg.md: tutorial mirroring plain.md structure, covering key generation, export, config, and sign/verify workflow Closes the CLI integration gap deferred by open-component-model#2560. On-behalf-of: @SAP <jakob.moeller@sap.com> Signed-off-by: Jakob Möller <contact@jakob-moeller.com> On-behalf-of: @SAP <jakob.moeller@sap.com>
3dda432 to
b368f34
Compare
…torial The CLI defaults to RSASSA-PSS when no signer spec is provided; GPG requires an explicit GPGSigningConfiguration/v1alpha1 spec. Add --signer-spec/--verifier-spec to all sign/verify calls in both the integration test and the website tutorial. Also aligns the tutorial structure with plain.md: adds an export-keys step, splits signer-spec creation into the configure step, and adds a Q&A entry explaining why a signer spec is required for GPG. Verified end-to-end against a local CLI build. Signed-off-by: Jakob Möller <contact@jakob-moeller.com> On-behalf-of: @SAP <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com> On-behalf-of: @SAP <jakob.moeller@sap.com>
handler.New ignores the passed scheme; GetSigningHandlerScheme() on the handler provides its own scheme, which the registry reads directly via RegisterInternalComponentSignatureHandler. Signed-off-by: Jakob Möller <contact@jakob-moeller.com> On-behalf-of: @SAP <jakob.moeller@sap.com>
## Summary Registers the GPG/OpenPGP signing handler (added in #2560) as a built-in CLI plugin alongside RSA and Sigstore. PR #2560 explicitly deferred CLI integration to a follow-up — this is that follow-up. - New `cli/internal/plugin/builtin/gpg/register.go` — registration shim mirroring the RSA pattern - `cli/internal/plugin/builtin/builtin.go` — registers GPG plugin at CLI startup - `cli/go.mod` — adds direct dependency on `bindings/go/gpg` - `cli/integration/signing_gpg_integration_test.go` — CLI-level round-trip integration test covering: - Happy path: sign then verify - Dry-run: verify must fail after `--dry-run`, then succeed after real sign - Wrong key: verify with a different public key must fail - `website/content/docs/tutorials/signing/gpg.md` — tutorial (weight 30, after plain.md/pem.md) covering GPG key generation, export, credential config, and sign/verify workflow ## Test plan - [ ] `Build (cli)` passes — `go build ./...` in `cli/` - [ ] `golangci-lint (cli)` passes - [ ] `Integration Tests (cli)` passes — `Test_Integration_Signing_GPG` round-trip with live OCI registry - [ ] `Spellcheck` passes - [ ] `DCO` passes --------- Signed-off-by: Jakob Möller <contact@jakob-moeller.com> f6930ce
Self-contained terminal demo for the OCM CLI GPG sign/verify workflow. Generates a temporary GPG keypair, creates a CTF component version, signs it with the GPG handler (wired in via PR open-component-model#2675), verifies the signature, then cleans up the test key. Usage: bash demo-gpg/setup.sh [OCM_BIN=/path/to/ocm] On-behalf-of: @SAP <jakob.moeller@sap.com>
Self-contained terminal demo for the OCM CLI GPG sign/verify workflow. Generates a temporary GPG keypair, creates a CTF component version, signs it with the GPG handler (wired in via PR open-component-model#2675), verifies the signature, then cleans up the test key. Usage: bash demo-gpg/setup.sh [OCM_BIN=/path/to/ocm] On-behalf-of: @SAP <jakob.moeller@sap.com>
Self-contained terminal demo for the OCM CLI GPG sign/verify workflow. Generates a temporary GPG keypair, creates a CTF component version, signs it with the GPG handler (wired in via PR open-component-model#2675), verifies the signature, then cleans up the test key. Usage: bash demo-gpg/setup.sh [OCM_BIN=/path/to/ocm] On-behalf-of: @SAP <jakob.moeller@sap.com>
Summary
Registers the GPG/OpenPGP signing handler (added in #2560) as a built-in CLI plugin alongside RSA and Sigstore.
PR #2560 explicitly deferred CLI integration to a follow-up — this is that follow-up.
cli/internal/plugin/builtin/gpg/register.go— registration shim mirroring the RSA patterncli/internal/plugin/builtin/builtin.go— registers GPG plugin at CLI startupcli/go.mod— adds direct dependency onbindings/go/gpgcli/integration/signing_gpg_integration_test.go— CLI-level round-trip integration test covering:--dry-run, then succeed after real signwebsite/content/docs/tutorials/signing/gpg.md— tutorial (weight 30, after plain.md/pem.md) covering GPG key generation, export, credential config, and sign/verify workflowTest plan
Build (cli)passes —go build ./...incli/golangci-lint (cli)passesIntegration Tests (cli)passes —Test_Integration_Signing_GPGround-trip with live OCI registrySpellcheckpassesDCOpasses