feat: cli credentials rollout#2642
Conversation
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
✅ Deploy Preview for ocm-website canceled.
|
|
Warning Review limit reached
More reviews will be available in 10 minutes and 30 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 (3)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR migrates CLI command credential resolution and plugin interfaces from untyped map-based credentials to typed ChangesTyped Credentials Migration
Sequence Diagram(s)sequenceDiagram
participant CLI Command
participant Credential Graph
participant Plugin Handler
participant Credential Plugin
CLI Command->>Credential Graph: Resolve(ctx, consumerIdentity)
Credential Graph->>Credential Plugin: get credentials
Credential Plugin-->>Credential Graph: runtime.Typed (e.g., DirectCredentials)
Credential Graph-->>CLI Command: runtime.Typed
CLI Command->>Plugin Handler: execute with typed credentials
Plugin Handler-->>CLI Command: result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
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)
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 |
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com> Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR migrates CLI/plugin credential handling from plain map[string]string attributes to typed credential objects (runtime.Typed), aligning the CLI with newer OCM bindings and plugin APIs.
Changes:
- Update multiple plugin/provider interfaces to accept/return
runtime.Typedcredentials instead ofmap[string]string. - Adapt CLI commands and integration tests to pass typed credential specs (e.g., OCI credentials).
- Bump and realign Go module dependencies across
cliandbindingsmodules.
Reviewed changes
Copilot reviewed 13 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/internal/repository/ocm/compatibility_test.go | Updates mock provider method signature for typed credentials. |
| cli/internal/plugin/builtin/oidc/oidc_plugin.go | Changes OIDC Resolve to return typed credentials. |
| cli/internal/plugin/builtin/oci/component_lister.go | Updates component lister plugin signature to accept typed credentials. |
| cli/internal/plugin/builtin/credentials/oci/plugin.go | Adjusts OCI credential repository plugin registration to updated spec/identity types. |
| cli/integration/transfer_oci_artifact_integration_test.go | Updates integration test to use typed OCI credentials for uploads and typed creds plumbing. |
| cli/integration/go.mod | Bumps integration module dependencies to newer bindings versions. |
| cli/integration/go.sum | Updates checksums for bumped dependencies in the integration module. |
| cli/go.mod | Bumps core CLI dependencies and updates indirect dependency set. |
| cli/go.sum | Updates checksums for bumped dependencies in the CLI module. |
| cli/cmd/verify/component-version/cmd.go | Switches verification credential resolution/plumbing to runtime.Typed. |
| cli/cmd/sign/component-version/cmd.go | Switches signing credential resolution/plumbing to runtime.Typed. |
| cli/cmd/download/shared/common.go | Switches resource download credential resolution to runtime.Typed. |
| cli/cmd/add/component-version/cmd.go | Updates constructor interfaces and target repo creds resolution to runtime.Typed. |
| bindings/go/transfer/integration/go.mod | Bumps transfer integration dependencies to newer descriptor/runtime + transfer versions. |
| bindings/go/transfer/integration/go.sum | Updates checksums for transfer integration dependency bumps. |
| bindings/go/sigstore/go.mod | Adjusts sigstore module dependencies (credentials now a direct requirement). |
| bindings/go/sigstore/go.sum | Rewrites checksums set after dependency graph changes. |
| bindings/go/repository/go.sum | Updates checksums due to bindings dependency bumps. |
| bindings/go/input/utf8/go.sum | Updates checksums due to bindings dependency bumps. |
| bindings/go/input/file/go.sum | Updates checksums due to bindings dependency bumps. |
| bindings/go/input/dir/go.sum | Updates checksums due to bindings dependency bumps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return nil, fmt.Errorf("OIDC authentication: %w", err) | ||
| } | ||
| return map[string]string{credentialKeyToken: token.RawToken}, nil | ||
| return &v1.DirectCredentials{Properties: map[string]string{credentialKeyToken: token.RawToken}}, nil |
| github.com/Masterminds/semver/v3 v3.5.0 | ||
| github.com/coreos/go-oidc/v3 v3.18.0 | ||
| github.com/jedib0t/go-pretty/v6 v6.7.10 | ||
| github.com/jedib0t/go-pretty/v6 v6.7.9 |
| go.opentelemetry.io/proto/otlp v1.10.0 // indirect | ||
| go.yaml.in/yaml/v2 v2.4.4 // indirect | ||
| go.yaml.in/yaml/v3 v3.0.4 // indirect | ||
| go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect |
On-behalf-of: SAP matthias.bruns@sap.com
What this PR does / why we need it
Final PR of the breaking change chain for the credential migration.
This PR updated the CLI.
Which issue(s) this PR fixes
Fixed: open-component-model/ocm-project#1056
Testing
How to test the changes
Verification
task testandtask test/integrationif applicable)go workis enabled (seego.work)ocm