Skip to content

feat(sigstore)!: add issuer/clientID to SignConfig for enterprise OIDC#2512

Merged
morri-son merged 4 commits into
open-component-model:mainfrom
morri-son:feat/sigstore-enterprise-oidc-config
May 15, 2026
Merged

feat(sigstore)!: add issuer/clientID to SignConfig for enterprise OIDC#2512
morri-son merged 4 commits into
open-component-model:mainfrom
morri-son:feat/sigstore-enterprise-oidc-config

Conversation

@morri-son

@morri-son morri-son commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

As a prerequiste for #2346 we require this PR to get merged. It contains the move of required fields from the credential into the consumer identity: issuer and clientID:

  • Add Issuer and ClientID fields to SigstoreSigningConfiguration/v1alpha1 so enterprise Sigstore stacks can be configured via the signer spec
  • Handler emits these into the credential consumer identity, enabling .ocmconfig entries to distinguish between different Sigstore deployments
  • Remove algorithm attribute from consumer identity (dispatch by config type makes it redundant; the algorithm field in SignatureInfo is preserved for forward-compatible verification)
  • Fix duplicate line in doc.go and rewrite consumer identity documentation
  • Convert handler tests to table-driven style
  • Regenerate SignConfig.schema.json
  • Add token refresh task for manual tests

Context

Split from #2346 to comply with the cross-module rule — this PR contains only bindings/go/sigstore/ changes. The CLI changes in #2346 will be rebased onto this after merge and module release.

Test plan

@morri-son morri-son requested a review from a team as a code owner May 13, 2026 20:59
@netlify

netlify Bot commented May 13, 2026

Copy link
Copy Markdown

Deploy Preview for ocm-website canceled.

Name Link
🔨 Latest commit 1e19f4b
🔍 Latest deploy log https://app.netlify.com/projects/ocm-website/deploys/6a06d80914052e0008fe25f5

@github-actions github-actions Bot added the kind/feature new feature, enhancement, improvement, extension label May 13, 2026
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Rate limit exceeded

@Skarlso has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 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: 86091d88-2a45-4de9-ad24-402b9447e36a

📥 Commits

Reviewing files that changed from the base of the PR and between b8aa15a and 1e19f4b.

📒 Files selected for processing (4)
  • bindings/go/sigstore/integration/Taskfile.yml
  • bindings/go/sigstore/signing/handler/handler.go
  • bindings/go/sigstore/signing/v1alpha1/config.go
  • bindings/go/sigstore/signing/v1alpha1/config_test.go
📝 Walkthrough

Walkthrough

Adds optional OIDC Issuer and ClientID to SignConfig, updates handler identity attributes to emit those values for signing identities, removes the algorithm identity attribute, converts handler tests to table-driven cases, updates identity-matching docs, and implements an integration Taskfile token-refresh flow.

Changes

Sigstore OIDC Issuer and Client ID Support

Layer / File(s) Summary
SignConfig schema and validation
bindings/go/sigstore/signing/v1alpha1/config.go, bindings/go/sigstore/signing/v1alpha1/config_test.go, bindings/go/sigstore/signing/v1alpha1/schemas/SignConfig.schema.json
Add exported Issuer and ClientID fields to SignConfig with omitempty JSON tags; Validate() checks Issuer when present; schema documents clientID and issuer; tests add success cases for these fields.
Handler identity attributes and construction
bindings/go/sigstore/signing/handler/handler.go, bindings/go/sigstore/signing/handler/internal/credentials/credentials.go
Remove IdentityAttributeAlgorithm; add IdentityAttributeIssuer and IdentityAttributeClientID; credentialIdentity no longer pre-populates algorithm; GetSigningCredentialConsumerIdentity conditionally adds issuer/clientID from SignConfig; identity-matching docs updated.
Handler test coverage
bindings/go/sigstore/signing/handler/handler_test.go
Refactor signing/verifying identity tests into table-driven cases covering minimal/public and enterprise signer configs, and supported vs unsupported media types; remove assertions for algorithm.
Documentation and integration task updates
bindings/go/sigstore/doc.go, bindings/go/sigstore/integration/Taskfile.yml
Package docs revised to describe signing/verifier identities and OIDC token resolution via the credential graph; scaffolding:refresh now refreshes SIGSTORE_OIDC_TOKEN in-place by calling the gettoken service (macOS/Linux handling).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Skarlso
  • matthiasbruns
  • piotrjanik

Poem

🐰 A rabbit with a token to find,
Hops through identities, issuer in mind,
ClientID tucked in a leaf so neat,
Tests table-driven make the flow complete,
Docs and tasks hum — the token's now renewed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately and specifically describes the main change: adding issuer/clientID fields to SignConfig for enterprise OIDC support in sigstore.
Description check ✅ Passed The pull request description is directly related to the changeset, providing detailed context, objectives, and test plans that align with the code changes across multiple files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 the size/m Medium label May 13, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
bindings/go/sigstore/signing/handler/handler_test.go (1)

901-937: ⚡ Quick win

Add a clientID-only case to complete identity-attribute coverage.

The table currently covers none, issuer-only, and issuer+clientID, but not clientID-only. Adding it would guard the conditional emission path independently.

Proposed test case addition
 		{
 			name: "issuer only",
 			cfg: func() *v1alpha1.SignConfig {
 				c := &v1alpha1.SignConfig{Issuer: "https://dex.example.com"}
 				c.SetType(runtime.NewVersionedType(v1alpha1.SignConfigType, v1alpha1.Version))
 				return c
 			}(),
 			wantLen:    3,
 			wantIssuer: "https://dex.example.com",
 		},
+		{
+			name: "clientID only",
+			cfg: func() *v1alpha1.SignConfig {
+				c := &v1alpha1.SignConfig{ClientID: "corp-sigstore"}
+				c.SetType(runtime.NewVersionedType(v1alpha1.SignConfigType, v1alpha1.Version))
+				return c
+			}(),
+			wantLen:      3,
+			wantClientID: "corp-sigstore",
+		},
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bindings/go/sigstore/signing/handler/handler_test.go` around lines 901 - 937,
Add a test case to the tests table in handler_test.go that exercises a
clientID-only SignConfig to cover the missing identity-attribute path: create a
cfg using &v1alpha1.SignConfig{ClientID: "corp-sigstore-only"} (call
c.SetType(runtime.NewVersionedType(v1alpha1.SignConfigType, v1alpha1.Version)))
and add expectations wantLen: 3 and wantClientID: "corp-sigstore-only" so the
suite now covers none, issuer-only, clientID-only, and issuer+clientID
scenarios.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bindings/go/sigstore/integration/Taskfile.yml`:
- Around line 121-128: The sed call in the scaffolding:refresh Taskfile task
that edits {{.SIGSTORE_ENV_FILE}} uses GNU-style `sed -i` which breaks on
macOS/BSD; update the task to detect Darwin (using `uname`) and run `sed -i ''
"s|^export SIGSTORE_OIDC_TOKEN=.*|export SIGSTORE_OIDC_TOKEN='${TOKEN}'|"
{{.SIGSTORE_ENV_FILE}}` on macOS and `sed -i "s|^export
SIGSTORE_OIDC_TOKEN=.*|export SIGSTORE_OIDC_TOKEN='${TOKEN}'|"
{{.SIGSTORE_ENV_FILE}}` on other platforms (or set a SED_INPLACE var to `-i ''`
for Darwin and `-i` otherwise) so the edit works portably.

---

Nitpick comments:
In `@bindings/go/sigstore/signing/handler/handler_test.go`:
- Around line 901-937: Add a test case to the tests table in handler_test.go
that exercises a clientID-only SignConfig to cover the missing
identity-attribute path: create a cfg using &v1alpha1.SignConfig{ClientID:
"corp-sigstore-only"} (call
c.SetType(runtime.NewVersionedType(v1alpha1.SignConfigType, v1alpha1.Version)))
and add expectations wantLen: 3 and wantClientID: "corp-sigstore-only" so the
suite now covers none, issuer-only, clientID-only, and issuer+clientID
scenarios.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e1c84e86-91aa-40ca-b8c0-b773320b4f06

📥 Commits

Reviewing files that changed from the base of the PR and between 885b2f6 and 1885afb.

📒 Files selected for processing (8)
  • bindings/go/sigstore/doc.go
  • bindings/go/sigstore/integration/Taskfile.yml
  • bindings/go/sigstore/signing/handler/handler.go
  • bindings/go/sigstore/signing/handler/handler_test.go
  • bindings/go/sigstore/signing/handler/internal/credentials/credentials.go
  • bindings/go/sigstore/signing/v1alpha1/config.go
  • bindings/go/sigstore/signing/v1alpha1/config_test.go
  • bindings/go/sigstore/signing/v1alpha1/schemas/SignConfig.schema.json

Comment thread bindings/go/sigstore/integration/Taskfile.yml Outdated
@morri-son morri-son force-pushed the feat/sigstore-enterprise-oidc-config branch from 1885afb to f3cfa5e Compare May 13, 2026 21:05
Add Issuer and ClientID fields to SigstoreSigningConfiguration so that
enterprise Sigstore stacks can be configured via the signer spec. The
handler emits these into the credential consumer identity, enabling
.ocmconfig entries to distinguish between different Sigstore deployments.

- Remove algorithm attribute from consumer identity (dispatch by config
  type makes it redundant; existing algorithm field in SignatureInfo is
  preserved for forward-compatible verification)
- Fix duplicate line in doc.go and rewrite consumer identity docs
- Convert handler tests to table-driven style
- Regenerate SignConfig JSON schema

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@morri-son morri-son force-pushed the feat/sigstore-enterprise-oidc-config branch from f3cfa5e to 1775642 Compare May 13, 2026 21:06
@morri-son morri-son enabled auto-merge (squash) May 13, 2026 21:39
Comment thread bindings/go/sigstore/integration/Taskfile.yml
Comment thread bindings/go/sigstore/signing/handler/handler.go
Comment thread bindings/go/sigstore/signing/v1alpha1/config.go

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

Two questions really. Other than that, this is fine.

@Skarlso Skarlso changed the title feat(sigstore): add issuer/clientID to SignConfig for enterprise OIDC feat(sigstore)!: add issuer/clientID to SignConfig for enterprise OIDC May 15, 2026
@github-actions github-actions Bot added the !BREAKING-CHANGE! Breaking change in API or ocm-cli or spec label May 15, 2026
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bindings/go/sigstore/signing/v1alpha1/config.go`:
- Around line 129-133: The current validateURL check allows schemeless or
non-HTTPS issuers and URLs with query/fragment; update validateURL (used by the
Issuer validation and VerifyConfig.CertificateOIDCIssuer) to enforce OIDC rules:
require url.IsAbs() true, url.Scheme == "https", non-empty url.Host, and ensure
url.RawQuery and url.Fragment are empty; return a descriptive error if any of
these checks fail so both the Issuer and CertificateOIDCIssuer validations
reject invalid OIDC issuer formats.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7898d1fa-fa11-456e-a77d-99bad6ac2f5d

📥 Commits

Reviewing files that changed from the base of the PR and between 1885afb and b8aa15a.

📒 Files selected for processing (8)
  • bindings/go/sigstore/doc.go
  • bindings/go/sigstore/integration/Taskfile.yml
  • bindings/go/sigstore/signing/handler/handler.go
  • bindings/go/sigstore/signing/handler/handler_test.go
  • bindings/go/sigstore/signing/handler/internal/credentials/credentials.go
  • bindings/go/sigstore/signing/v1alpha1/config.go
  • bindings/go/sigstore/signing/v1alpha1/config_test.go
  • bindings/go/sigstore/signing/v1alpha1/schemas/SignConfig.schema.json
✅ Files skipped from review due to trivial changes (1)
  • bindings/go/sigstore/signing/handler/internal/credentials/credentials.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • bindings/go/sigstore/signing/v1alpha1/schemas/SignConfig.schema.json
  • bindings/go/sigstore/signing/v1alpha1/config_test.go
  • bindings/go/sigstore/signing/handler/handler.go
  • bindings/go/sigstore/signing/handler/handler_test.go
  • bindings/go/sigstore/integration/Taskfile.yml

Comment thread bindings/go/sigstore/signing/v1alpha1/config.go
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Comment thread bindings/go/sigstore/signing/handler/handler.go
@morri-son morri-son merged commit 4a81396 into open-component-model:main May 15, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!BREAKING-CHANGE! Breaking change in API or ocm-cli or spec kind/feature new feature, enhancement, improvement, extension size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants