Skip to content

feat(cli): sign/verify support#895

Merged
jakobmoellerdev merged 31 commits into
open-component-model:mainfrom
jakobmoellerdev:plugin-signing-cli-rebase
Oct 1, 2025
Merged

feat(cli): sign/verify support#895
jakobmoellerdev merged 31 commits into
open-component-model:mainfrom
jakobmoellerdev:plugin-signing-cli-rebase

Conversation

@jakobmoellerdev

@jakobmoellerdev jakobmoellerdev commented Sep 17, 2025

Copy link
Copy Markdown
Member

What this does

adds ocm sign cv / ocm verify cv support to OCM CLI.

Why this change is needed

This actually uses the handlers prepared before for OCM signing support in open-component-model/ocm-project#648

Needs #885

fix open-component-model/ocm-project#649

### What this does
- Updated multiple Go module dependencies in the `cli/go.mod` and `cli/go.sum` files, improving compatibility and functionality.
  - Upgraded `go.yaml.in/yaml/v2` to v2.4.3 and `ocm.software/open-component-model/bindings` modules to their latest versions, including `credentials`, `repository`, and `descriptor`.
  - Updates to `golang.org/x/net` and `github.com/dlclark/regexp2` etc., for bug fixes and stability enhancements.
- Introduced `compref/options.go` in `cli/internal/reference` to handle CTF access mode options:
  - Added `Options` struct and related functionality for applying and creating CTF configuration.
  - Included `WithCTFAccessMode` configuration helper.

### Why this change is needed
- Keeps Go dependencies up-to-date to leverage bug fixes, security patches, and feature enhancements.
- The new `compref/options.go` enables better configurability and modular handling of CTF-related options, improving maintainability and extendability.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
#### What this does
- Added a new `SigningRegistry` to manage signing handler plugins.
- Integrated signing handler support into the plugin manager and registries.
- Updated dependencies in `go.mod` and `go.sum` to include the signing library.
- Adjusted test cases to align with the new signing plugin functionality.

#### Why this change is needed
- Expands the plugin framework capabilities to include signing handlers for enhanced security and verification processes.
- Improves extensibility by enabling seamless integration and management of signing plugins.
- Ensures alignment with the evolving requirements for cryptographic operations on component descriptors.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
### What this does
- Upgraded `ocm.software/open-component-model/bindings/go/descriptor/runtime` from `v0.0.0-20250909064434-e1a06fe74668` to `v0.0.0-20250915165427-710b0c881b3c`.
- Updated `go.mod` and `go.sum` to reflect the newer version.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
### What this does
- Introduced a new Go-based test signing handler plugin under `plugin/internal/testplugin-signinghandler`.
- Implements basic signing and verifying capabilities with dummy data for testing purposes:
  - `Sign` and `Verify` operations.
  - Retrieval of signer and verifier identities.
- Added plugin initialization logic with logging, configuration parsing, and capability registration.

### Why this change is needed
- Provides a foundation for testing signing plugin functionality within the Open Component Model ecosystem.
- Supports the development and verification of plugin-based cryptographic operations with minimal overhead.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/l Large labels Sep 17, 2025
…-signing-cli-rebase

# Conflicts:
#	bindings/go/plugin/manager/registries/signinghandler/converter.go
#	bindings/go/plugin/manager/registries/signinghandler/endpoints_function.go
#	bindings/go/plugin/manager/registries/signinghandler/endpoints_function_test.go
#	bindings/go/plugin/manager/registries/signinghandler/handlers_test.go
#	bindings/go/plugin/manager/registries/signinghandler/implementations.go
#	bindings/go/plugin/manager/registries/signinghandler/implementations_test.go
#	bindings/go/plugin/manager/registries/signinghandler/registry_test.go
#	cli/cmd/add/component-version/cmd.go
#	cli/go.mod
#	cli/go.sum
#	cli/integration/go.mod
#	cli/integration/go.sum
#	cli/internal/repository/ocm/repository.go
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
…rebase

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>

# Conflicts:
#	cli/go.mod
#	cli/go.sum
#	cli/integration/go.mod
#	cli/integration/go.sum
…rebase

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
@jakobmoellerdev jakobmoellerdev force-pushed the plugin-signing-cli-rebase branch from 2e44ad0 to 8372afb Compare September 19, 2025 08:32
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
@jakobmoellerdev jakobmoellerdev force-pushed the plugin-signing-cli-rebase branch from 46df4cf to 58bad55 Compare September 19, 2025 13:40
@github-actions github-actions Bot added the component/github-actions Changes on GitHub Actions or within `.github/` directory label Sep 19, 2025
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review September 19, 2025 20:17
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner September 19, 2025 20:17
Comment thread cli/cmd/sign/component-version/cmd.go Outdated
Comment thread cli/cmd/sign/component-version/cmd.go Outdated
Comment thread cli/cmd/sign/component-version/cmd.go Outdated

@matthiasbruns matthiasbruns left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI implementation looks solid
My two cents

  • duplicated code in sign an verify
  • I feel that CLI has a lot of responsibilities, maybe we should move stuff out of the command itself to make things more reusable

Comment thread cli/cmd/verify/component-version/cmd.go Outdated
Comment thread cli/cmd/verify/component-version/cmd.go Outdated
- Moved digest generation and verification logic to a new `signing` package for better modularity and maintainability.
- Updated commands to use the `signing` package for digest operations.
- Adjusted flag descriptions for `--signer-spec` and `--verifier-spec` to clarify default behavior.

This refactor centralizes digest-related operations, making it easier to test, extend, and maintain. Additionally, the changes improve user-facing documentation and flag usability.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
@jakobmoellerdev

Copy link
Copy Markdown
Member Author

I feel that CLI has a lot of responsibilities, maybe we should move stuff out of the command itself to make things more reusable

I think thats a good point, but im wondering how you would like to split behavior. Im happy to hear any suggestions

@Skarlso Skarlso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One remark.

Comment thread cli/cmd/verify/component-version/cmd.go Outdated
…t versions

- Refactored `VerifyComponentVersion` to `SignComponentVersion` to align with its primary functionality.
- Added support for output formats (`json`, `yaml`) using a new `--output` flag.
- Introduced the capability to load signer specifications via `runtime.Typed` from external files.
- Enhanced context checks for better error handling during repository and plugin manager initialization.
- Improved logging for actions like credential usage, signature overwriting, and successful operations.
- Simplified flag handling and validated consistency for signature-related operations.
- Abstracted signer specification loading and rendering as reusable utilities for clarity and maintainability.

These improvements streamline signing workflows, enhance user flexibility with output formats, and improve robustness through better error handling and logging.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Comment thread cli/cmd/sign/component-version/cmd.go Outdated
Comment thread cli/cmd/sign/component-version/cmd.go Outdated
Comment thread cli/internal/plugin/builtin/rsa/register.go Outdated
Comment thread cli/cmd/verify/component-version/cmd.go Outdated
Comment thread cli/cmd/verify/cmd.go Outdated
Comment thread cli/cmd/verify/component-version/cmd.go Outdated
Comment thread cli/cmd/verify/component-version/cmd.go Outdated
Comment thread cli/cmd/sign/cmd.go Outdated
Comment thread cli/internal/signing/digest.go Outdated
Comment thread cli/cmd/verify/component-version/cmd.go
…ication

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
@jakobmoellerdev jakobmoellerdev force-pushed the plugin-signing-cli-rebase branch from 17e1cae to 05ca493 Compare September 25, 2025 13:22
Comment thread cli/cmd/verify/component-version/cmd.go Outdated
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Skarlso
Skarlso previously approved these changes Sep 29, 2025
…rebase

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>

# Conflicts:
#	cli/go.mod
#	cli/go.sum
#	cli/integration/go.mod
Comment thread cli/cmd/sign/component-version/cmd.go Outdated
Comment thread cli/cmd/verify/component-version/cmd.go Outdated
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
fabianburth
fabianburth previously approved these changes Sep 30, 2025
…rebase

# Conflicts:
#	.github/config/wordlist.txt
@matthiasbruns

Copy link
Copy Markdown
Contributor

I feel that CLI has a lot of responsibilities, maybe we should move stuff out of the command itself to make things more reusable

I think thats a good point, but im wondering how you would like to split behavior. Im happy to hear any suggestions

I think this is a general problem with the ci right now - we can discuss this outside of this pr

@jakobmoellerdev jakobmoellerdev enabled auto-merge (squash) October 1, 2025 10:08
@jakobmoellerdev jakobmoellerdev merged commit bce087a into open-component-model:main Oct 1, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/github-actions Changes on GitHub Actions or within `.github/` directory kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement & Test ocm sign componentversion

4 participants