Skip to content

feat: migrate oci to typed credentials#2594

Merged
matthiasbruns merged 7 commits into
open-component-model:mainfrom
matthiasbruns:feat/702_typed_credentials_oci
May 21, 2026
Merged

feat: migrate oci to typed credentials#2594
matthiasbruns merged 7 commits into
open-component-model:mainfrom
matthiasbruns:feat/702_typed_credentials_oci

Conversation

@matthiasbruns

@matthiasbruns matthiasbruns commented May 21, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it

This PR migrates the following bindings to runtime.Typed credentials

  • oci

Since we cascade the repository breaking changes, set public consts to private and change the spec, this is a breaking change.

The migration path can be observed here: #2519

Which issue(s) this PR fixes

Contributes:

Testing

  • breaking change only tested with binding tests
  • go.work disabled, task test is green

@netlify

netlify Bot commented May 21, 2026

Copy link
Copy Markdown

Deploy Preview for ocm-website canceled.

Name Link
🔨 Latest commit 401ac5b
🔍 Latest deploy log https://app.netlify.com/projects/ocm-website/deploys/6a0f009edd82fd0008b631ae

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Rate limit exceeded

@matthiasbruns has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 15 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07fcbe53-dcc2-4370-8d72-db12b3c420e1

📥 Commits

Reviewing files that changed from the base of the PR and between 2be2fc9 and 401ac5b.

⛔ Files ignored due to path filters (2)
  • bindings/go/oci/go.sum is excluded by !**/*.sum
  • bindings/go/oci/integration/go.sum is excluded by !**/*.sum
📒 Files selected for processing (35)
  • bindings/go/oci/credentials/credential_repository.go
  • bindings/go/oci/credentials/docker_config.go
  • bindings/go/oci/credentials/docker_config_test.go
  • bindings/go/oci/go.mod
  • bindings/go/oci/integration/go.mod
  • bindings/go/oci/integration/integration_test.go
  • bindings/go/oci/repository/provider/provider.go
  • bindings/go/oci/repository/resource/resource_repository.go
  • bindings/go/oci/spec/credentials/scheme.go
  • bindings/go/oci/spec/credentials/v1/convert.go
  • bindings/go/oci/spec/credentials/v1/convert_test.go
  • bindings/go/oci/spec/credentials/v1/docker_config.go
  • bindings/go/oci/spec/credentials/v1/oci_credentials.go
  • bindings/go/oci/spec/credentials/v1/oci_credentials_test.go
  • bindings/go/oci/spec/credentials/v1/schemas/OCICredentials.schema.json
  • bindings/go/oci/spec/identity/v1/convert.go
  • bindings/go/oci/spec/identity/v1/convert_test.go
  • bindings/go/oci/spec/identity/v1/oci_registry_identity.go
  • bindings/go/oci/spec/identity/v1/schemas/OCIRegistryIdentity.schema.json
  • bindings/go/oci/spec/identity/v1/type.go
  • bindings/go/oci/stream/stream.go
  • bindings/go/oci/transformer/add_component_version.go
  • bindings/go/oci/transformer/add_local_resource.go
  • bindings/go/oci/transformer/add_local_resource_test.go
  • bindings/go/oci/transformer/add_oci_artifact.go
  • bindings/go/oci/transformer/add_oci_artifact_test.go
  • bindings/go/oci/transformer/credentials.go
  • bindings/go/oci/transformer/credentials_test.go
  • bindings/go/oci/transformer/extract.go
  • bindings/go/oci/transformer/get_component_version.go
  • bindings/go/oci/transformer/get_local_resource.go
  • bindings/go/oci/transformer/get_local_resource_test.go
  • bindings/go/oci/transformer/get_oci_artifact.go
  • bindings/go/oci/transformer/get_oci_artifact_test.go
  • bindings/go/oci/transformer/transfer_oci_artifact.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/l Large labels May 21, 2026
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
@matthiasbruns matthiasbruns force-pushed the feat/702_typed_credentials_oci branch from 1860e3a to 5ae1e08 Compare May 21, 2026 11:45
matthiasbruns and others added 5 commits May 21, 2026 14:14
…contract

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>
@matthiasbruns matthiasbruns force-pushed the feat/702_typed_credentials_oci branch from 15aa648 to 2077e3e Compare May 21, 2026 12:53
@matthiasbruns

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
@matthiasbruns matthiasbruns force-pushed the feat/702_typed_credentials_oci branch from 2077e3e to 401ac5b Compare May 21, 2026 12:54
Comment thread bindings/go/oci/spec/identity/v1/convert.go
Comment thread bindings/go/oci/spec/identity/v1/convert.go
@matthiasbruns

Copy link
Copy Markdown
Contributor Author

I am not 100% sure about the identity parsing here - I'd like your feedback on this

@matthiasbruns matthiasbruns marked this pull request as ready for review May 21, 2026 12:59
@matthiasbruns matthiasbruns requested a review from a team as a code owner May 21, 2026 13:00

@frewilhelm frewilhelm 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.

nice

@matthiasbruns matthiasbruns merged commit f914013 into open-component-model:main May 21, 2026
22 checks passed
jakobmoellerdev added a commit to jakobmoellerdev/open-component-model that referenced this pull request May 21, 2026
Updates all credential-passing interfaces in the constructor binding from
map[string]string to runtime.Typed, following the same pattern established
by the OCI (open-component-model#2594), blob, rsa, and signing (open-component-model#2580) migrations.

- ProcessResource, ProcessSource, ProcessResourceDigest, DownloadResource
  now accept runtime.Typed instead of map[string]string
- resolveCredentials now calls ResolveTyped and returns runtime.Typed
- Bumps credentials dependency from v0.0.10 to v0.0.11

Contributes to: open-component-model/ocm-project#1055

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>
jakobmoellerdev added a commit that referenced this pull request May 21, 2026
#### What this PR does / why we need it

Migrates the `constructor` binding to use `runtime.Typed` credentials,
following the established pattern from:
- #2580 (blob, rsa, signing)
- #2594 (oci)

Updates the following interfaces from `map[string]string` →
`runtime.Typed`:
- `ResourceInputMethod.ProcessResource`
- `SourceInputMethod.ProcessSource`
- `ResourceDigestProcessor.ProcessResourceDigest`
- `ResourceRepository.DownloadResource`

Also migrates `resolveCredentials` to call `ResolveTyped` and bumps the
`credentials` dependency from `v0.0.10` → `v0.0.11`.

#### Which issue(s) this PR fixes

Contributes:
- open-component-model/ocm-project#1055

Part of the migration path:
#2519

#### Dependencies

This PR depends on #2594 (oci) being merged first.

#### Testing
- All existing constructor binding tests pass (`go test ./...`)
- Breaking change — callers must update mock implementations to accept
`runtime.Typed`

---------

Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
jakobmoellerdev added a commit that referenced this pull request May 22, 2026
)

## Summary

Gate 6 of the phased [ADR 0018 / issue
#1047](open-component-model/ocm-project#1047)
credentials migration. Builds on gates 1–5 (PRs #2580, #2586, #2594,
#2598, #2602).

> **Note:** this branch also contains #2613 (plugin
`CredentialsFromHeader` refactor). Once that merges, this PR will show
only the helm changes.

### helm binding changes

- `cmd/main.go`, `input/method.go`: `ProcessResource`/`ProcessSource` →
`runtime.Typed`
- `digest/digest.go`: `ProcessResourceDigest` → `runtime.Typed`; single
`ConvertCredentials` call replaces two separate conversions
- `repository/resource/resource_repository.go`:
`DownloadResource`/`UploadResource` → `runtime.Typed`; `var _
repository.ResourceRepository` assertion restored
- `transformation/get_helm_chart.go`: use upstream typed
`ResourceRepository` interface; delete `transformation/credentials.go`
- `spec/credentials/v1/convert.go`: new
`ConvertCredentials(runtime.Typed) (*HelmHTTPCredentials,
*OCICredentials, error)` — single scheme-based conversion returning both
types
- `spec/credentials/scheme.go`: package-level `Scheme` for helm
credentials
- `spec/credentials/v1/helm_credentials.go`: remove deprecated exported
constants and `FromDirectCredentials` (now private)
- `go.mod`: `plugin` → v0.0.16, `blob` → v0.0.13, `repository` → v0.0.9;
no replace directives

## Test plan

- [ ] `cd bindings/go/helm && go build ./... && go test ./...` (cmd/*
requires `task build` for plugin binary)
- [ ] `grep -rn "map\[string\]string" bindings/go/helm/` returns no
credential parameter usages

Refs: #1047

Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
jakobmoellerdev added a commit that referenced this pull request May 26, 2026
…entials (gate 7) (#2616)

#### What this PR does / why we need it

Gate 7 of the typed credentials migration (ocm-project#1047).

Migrates `bindings/go/transfer` and `kubernetes/controller` to use
`runtime.Typed` credentials instead of `map[string]string`.

**bindings/go/transfer:**
- Bump `blob→v0.0.13`, `credentials→v0.0.12`, `oci→v0.0.43`,
`repository→v0.0.9`
- Update OCI identity import path: `oci/spec/credentials/identity/v1` →
`oci/spec/identity/v1`

**kubernetes/controller:**
- `resolveResourceCredentials` and `VerifyResource` return
`runtime.Typed` instead of `map[string]string`
- Replace `map[string]string` RSA credential literals with
`rsacredentialsv1.RSACredentials` structs
- Update import aliases for `oci/spec/credentials` and
`oci/spec/identity/v1`
- `GetComponentVersionRepository` call sites updated to pass
`runtime.Typed` credentials

#### Which issue(s) this PR fixes

Contributes:
- open-component-model/ocm-project#1047
- open-component-model/ocm-project#1055
- open-component-model/ocm-project#1056
- open-component-model/ocm-project#1057

#### Binding release order

| Gate | PRs | Modules | Status |
|------|-----|---------|--------|
| 1 | ✅ #2580 | blob, signing, rsa | merged |
| 2 | ✅ #2586 | repository, sigstore | merged |
| 3 | ✅ #2594 | oci | merged |
| 4 | ✅ #2598 | constructor | merged |
| 5 | ✅ #2602 | plugin, input/dir, input/file, input/utf8 | merged |
| 6 | ✅ #2612 | helm | merged |
| 7 | **this PR** | transfer, controller | 👈 |
| 8 | PR 8 | cli | — |

---------

Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Co-authored-by: Matthias Bruns <git@matthiasbruns.com>
@matthiasbruns matthiasbruns mentioned this pull request May 26, 2026
5 tasks
matthiasbruns added a commit that referenced this pull request May 26, 2026
On-behalf-of: SAP <matthias.bruns@sap.com>

<!-- markdownlint-disable MD041 -->
#### 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

| Gate | PRs | Modules | Status |
|------|-----|---------|--------|
| 1 | ✅ #2580 | blob, signing, rsa | merged |
| 2 | ✅ #2586 | repository, sigstore | merged |
| 3 | ✅ #2594 | oci | merged |
| 4 | ✅ #2598 | constructor | merged |
| 5 | ✅ #2602 | plugin, input/dir, input/file, input/utf8 | merged |
| 6 | ✅ #2612 | helm | merged |
| 7 | ✅  #2616 | transfer, controller | merged |
| 8 | **this PR** | cli | 👈 |

#### Testing

##### How to test the changes

##### Verification

- [ ] I have added/updated tests for my changes (see [Test
Requirements](../CONTRIBUTING.md#test-requirements))
- [x] Tests pass locally (`task test` and `task test/integration` if
applicable)
- [ ] If touching multiple modules, `go work` is enabled (see `go.work`)
- [x] My changes do not decrease test coverage
- [ ] I have tested the changes locally by running `ocm`

---------

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants