Skip to content

feat(website): add commit ID link to homepage footer#2287

Merged
jakobmoellerdev merged 6 commits into
open-component-model:mainfrom
morri-son:feat/add-commit-hash-to-website
Apr 15, 2026
Merged

feat(website): add commit ID link to homepage footer#2287
jakobmoellerdev merged 6 commits into
open-component-model:mainfrom
morri-son:feat/add-commit-hash-to-website

Conversation

@morri-son

@morri-son morri-son commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Inject git commit hash (scoped to website/ folder) as Hugo params at build time via HUGO_PARAMS_COMMITFULL / HUGO_PARAMS_COMMITSHORT env vars
  • Display clickable "Commit abc1234" link in homepage footer below Netlify icon
  • Link URL uses site.docsRepo config — no hardcoded repo URL
  • Graceful fallback: nothing rendered when env vars absent

Closes open-component-model/ocm-project#1017

Link will only work for the first time once merge to the monorepo.

Test plan

  • Run npm run build in website/, verify commit hash appears in footer HTML
  • Run npm run dev, check footer shows commit link on homepage
  • Verify link points to correct GitHub commit URL
  • Build without env vars (run hugo directly) — confirm no commit shown

@morri-son morri-son requested a review from a team as a code owner April 14, 2026 18:07
@netlify

netlify Bot commented Apr 14, 2026

Copy link
Copy Markdown

Deploy Preview for ocm-website ready!

Name Link
🔨 Latest commit eca2db1
🔍 Latest deploy log https://app.netlify.com/projects/ocm-website/deploys/69de840da759aa000872ac2a
😎 Deploy Preview https://deploy-preview-2287--ocm-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/l Large labels Apr 14, 2026
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Introduces Sigstore keyless signing and verification support to the OCM CLI via cosign. Adds comprehensive Go bindings implementing signing/verification handlers, Docker-based integration tests with Sigstore infrastructure (Dex, Fulcio, Rekor, CT log, TSA), interactive OIDC authentication flow, built-in credential plugin, CLI commands with documentation, and Git commit hash display in website footer.

Changes

Cohort / File(s) Summary
Sigstore Go Bindings - Configuration & Metadata
bindings/go/sigstore/doc.go, bindings/go/sigstore/go.mod, bindings/go/sigstore/Taskfile.yml, bindings/go/sigstore/signing/v1alpha1/config.go, bindings/go/sigstore/signing/v1alpha1/algorithm.go, bindings/go/sigstore/signing/v1alpha1/group_version.go, bindings/go/sigstore/signing/v1alpha1/oidc_identity_token.go, bindings/go/sigstore/signing/v1alpha1/trusted_root_identity.go, bindings/go/sigstore/signing/v1alpha1/zz_generated.deepcopy.go
Package metadata, configuration types for signing/verification (SignConfig/VerifyConfig with OIDC/identity constraints), algorithm/media-type constants, and auto-generated deepcopy methods.
Cosign CLI Executor
bindings/go/sigstore/signing/handler/cosign.go, bindings/go/sigstore/signing/handler/cosign_version.go, bindings/go/sigstore/signing/handler/cosign_download.go, bindings/go/sigstore/signing/handler/cosign_download_test.go, bindings/go/sigstore/signing/handler/cosign_version.go
Cosign binary execution layer (SignData/VerifyData interface), automatic download/caching with SHA256 verification, version pinning (v3.0.6), and test coverage.
Signing & Verification Logic
bindings/go/sigstore/signing/handler/handler.go, bindings/go/sigstore/signing/handler/sign.go, bindings/go/sigstore/signing/handler/verify.go, bindings/go/sigstore/signing/handler/resolve.go, bindings/go/sigstore/signing/handler/config_test.go, bindings/go/sigstore/signing/handler/handler_test.go, bindings/go/sigstore/signing/handler/sign_test.go, bindings/go/sigstore/signing/handler/verify_test.go
Main signing/verification handler implementation with OIDC token resolution, bundle decoding, issuer extraction, trusted-root/signing-config path resolution, and comprehensive unit tests covering config conversion, error cases, and environment-variable overrides.
Integration Test Infrastructure
bindings/go/sigstore/integration/go.mod, bindings/go/sigstore/integration/Taskfile.yml, bindings/go/sigstore/integration/integration_test.go, bindings/go/sigstore/integration/internal/stack.go, bindings/go/sigstore/integration/internal/dex.go, bindings/go/sigstore/integration/internal/fulcio.go, bindings/go/sigstore/integration/internal/rekor.go, bindings/go/sigstore/integration/internal/ctlog.go, bindings/go/sigstore/integration/internal/tsa.go, bindings/go/sigstore/integration/internal/signing_config.go, bindings/go/sigstore/integration/internal/trusted_root.go
Docker-based Sigstore infrastructure orchestration (Dex OIDC provider, Fulcio CA, Rekor transparency log v2, CT log, TSA) with container lifecycle management, config/artifact building, and three integration test cases: keyless identity verification, tampered-bundle detection, offline verification.
CLI OIDC Flow
cli/internal/oidcflow/oidcflow.go, cli/internal/oidcflow/oidcflow_test.go
Interactive OIDC authorization code flow with PKCE, browser-based authentication, token exchange, and id_token verification; includes test coverage for flow components (random string generation, PKCE challenge derivation, callback handling, token waiting, options defaulting).
CLI Sigstore Plugin
cli/internal/plugin/builtin/cosign/oidc_plugin.go, cli/internal/plugin/builtin/cosign/oidc_plugin_test.go, cli/internal/plugin/builtin/cosign/register.go, cli/internal/plugin/builtin/builtin.go
Built-in Sigstore OIDC credential plugin (resolving ID tokens from environment or interactive flow), plugin registration, and registration integration.
CLI Sign/Verify Commands
cli/cmd/sign/component-version/cmd.go, cli/cmd/verify/component-version/cmd.go, cli/cmd/setup/setup.go, cli/cmd/cmd_test.go
Extended help text/examples for Sigstore keyless signing/verification with --signer-spec and --verifier-spec, credential plugin resolver integration, and test updates.
CLI Documentation
cli/docs/reference/ocm_sign_component-version.md, cli/docs/reference/ocm_verify_component-version.md
Reference documentation for Sigstore signing/verification with config examples, credential setup, and usage examples.
Build & Configuration
.github/config/wordlist.txt, .github/renovate.json5, Taskfile.yml, cli/go.mod
Added Sigstore-related dictionary entries, Renovate rule for cosign version updates, Taskfile includes for Go bindings, and new/updated module dependencies (go-oidc, oauth2, Sigstore bindings).
Website Footer
website/package.json, website/layouts/_partials/footer/footer.html
Git commit hash injection via environment variables (build-time) and footer template rendering with GitHub commit link and graceful fallback.

Sequence Diagram(s)

sequenceDiagram
    participant User as User/CLI
    participant Handler as Sigstore Handler
    participant Cosign as Cosign CLI
    participant CredPlugin as Credential Plugin
    participant OIDC as OIDC Provider
    participant Fulcio as Fulcio CA
    participant Rekor as Rekor TLog

    User->>Handler: Sign(digest, SignConfig, credentials)
    Handler->>CredPlugin: Resolve OIDC Identity Token
    CredPlugin->>OIDC: GetIDToken (interactive or env)
    OIDC-->>CredPlugin: ID Token
    CredPlugin-->>Handler: SIGSTORE_ID_TOKEN

    Handler->>Cosign: SignData(digest, SignOpts + token)
    Cosign->>Fulcio: Request code signing cert (with token)
    Fulcio-->>Cosign: Signed certificate
    Cosign->>Rekor: Record entry + artifact
    Rekor-->>Cosign: Inclusion proof
    Cosign-->>Handler: Sigstore Bundle (JSON)

    Handler->>Handler: Extract issuer from cert
    Handler-->>User: SignatureInfo (bundle + algorithm)
Loading
sequenceDiagram
    participant User as User/CLI
    participant Handler as Sigstore Handler
    participant Cosign as Cosign CLI
    participant TrustedRoot as Trusted Root
    participant Fulcio as Fulcio CA
    participant Rekor as Rekor TLog

    User->>Handler: Verify(signature, VerifyConfig, credentials)
    Handler->>Handler: Validate identity constraints
    Handler->>Handler: Resolve trusted root location
    TrustedRoot-->>Handler: Root certs + Rekor pubkey

    Handler->>Cosign: VerifyData(digest, bundle, VerifyOpts)
    Cosign->>Cosign: Decode bundle (cert + signature)
    Cosign->>Fulcio: Validate cert chain
    Fulcio-->>Cosign: Cert valid
    Cosign->>Cosign: Verify signature over digest
    Cosign->>Rekor: Verify tlog inclusion proof
    Rekor-->>Cosign: Proof verified
    Cosign->>Cosign: Extract + match issuer/identity
    Cosign-->>Handler: Success/Failure

    Handler-->>User: Nil (success) or Error
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • #1965: Modifies CLI help text in ocm sign component-version command to expand signer-spec documentation/examples with Sigstore references.
  • #2231: Updates .github/config/wordlist.txt with overlapping Sigstore-related dictionary entries.
  • #1932: Bumps Go module toolchain versions to 1.26.1, same as the new Sigstore bindings introduced in this PR.

Suggested labels

kind/feature, size/l, component/github-actions

Suggested reviewers

  • Skarlso
  • frewilhelm
  • piotrjanik

Poem

🐰 Sigstore's lock is now in place,
No secrets need to hide their face,
With OIDC's trusted dance so bright,
Your keyless signs reach cryptographic height!
A cosign waltz, a verify's delight!

🚥 Pre-merge checks | ✅ 1 | ❌ 4

❌ Failed checks (3 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements the website footer commit feature (issue #1017) but also includes extensive sigstore/cosign signing handler bindings that are not mentioned in or required by the linked issue. Address out-of-scope sigstore changes—either move them to a separate PR or document their relationship to issue #1017 in the PR description.
Out of Scope Changes check ⚠️ Warning The PR contains significant out-of-scope changes: extensive sigstore/cosign Go binding implementations, OIDC flow code, CLI enhancements, and dependency updates that are unrelated to the website footer feature described in issue #1017. Consider separating sigstore bindings (bindings/go/sigstore/*, cli changes, dependencies) into a distinct feature branch/PR focused on sigstore integration, keeping this PR narrowly scoped to website footer changes only.
Docstring Coverage ⚠️ Warning Docstring coverage is 36.03% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title mentions website footer changes but the PR includes extensive sigstore/cosign binding implementation unrelated to the footer feature. Clarify whether the PR title accurately reflects the main objective—consider whether sigstore bindings are the primary change or if the title should be updated to reflect all major changes in this changeset.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is directly related to the changeset, clearly explaining the intent to inject git commit hashes into Hugo parameters and display them in the website footer with a link.

✏️ 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 component/github-actions Changes on GitHub Actions or within `.github/` directory label Apr 14, 2026
Display the latest website-folder commit as a clickable link in the
footer below the Netlify icon. The short hash links to the full commit
on GitHub. Build/dev scripts inject HUGO_PARAMS_COMMITFULL and
HUGO_PARAMS_COMMITSHORT via git log at build time.

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@morri-son morri-son force-pushed the feat/add-commit-hash-to-website branch from 877629c to 2c38878 Compare April 14, 2026 18:11
@github-actions github-actions Bot added size/s Small and removed size/l Large labels Apr 14, 2026
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.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

🧹 Nitpick comments (10)
website/package.json (1)

8-8: Make build/dev scripts cross-platform compatible.

Lines 8, 15, and 16 use POSIX-only VAR=$(...) command syntax that will fail on Windows default npm shells. While the project doesn't explicitly target Windows, it already uses shx for cross-platform operations in other scripts (clean tasks), so applying the same pattern here would ensure consistency and prevent breakage for any Windows contributors.

Consider refactoring to a Node wrapper:

Cross-platform refactor (Node wrapper)
-    "build": "HUGO_PARAMS_COMMITFULL=$(git log -1 --format=%H -- .) HUGO_PARAMS_COMMITSHORT=$(git log -1 --format=%h -- .) ./node_modules/.bin/hugo --minify --gc",
+    "build": "node scripts/run-hugo-with-commit.mjs --minify --gc",
...
-    "dev:drafts": "HUGO_PARAMS_COMMITFULL=$(git log -1 --format=%H -- .) HUGO_PARAMS_COMMITSHORT=$(git log -1 --format=%h -- .) ./node_modules/.bin/hugo server --bind=0.0.0.0 --disableFastRender --baseURL=http://localhost --noHTTPCache --buildDrafts",
+    "dev:drafts": "node scripts/run-hugo-with-commit.mjs server --bind=0.0.0.0 --disableFastRender --baseURL=http://localhost --noHTTPCache --buildDrafts",
-    "dev": "HUGO_PARAMS_COMMITFULL=$(git log -1 --format=%H -- .) HUGO_PARAMS_COMMITSHORT=$(git log -1 --format=%h -- .) ./node_modules/.bin/hugo server --bind=0.0.0.0 --disableFastRender --noHTTPCache",
+    "dev": "node scripts/run-hugo-with-commit.mjs server --bind=0.0.0.0 --disableFastRender --noHTTPCache",

Also applies to: 15-16

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@website/package.json` at line 8, The npm scripts in package.json (notably the
"build" script and the other scripts using VAR=$(...) syntax) use POSIX-only
variable-substitution which breaks on Windows; replace them with a
cross-platform approach by creating a small Node wrapper (e.g.,
scripts/build.js) that runs git to compute commit hashes via child_process, sets
HUGO_PARAMS_COMMITFULL and HUGO_PARAMS_COMMITSHORT on process.env, and then
spawns the Hugo binary (./node_modules/.bin/hugo) so package.json's "build" (and
the other offending scripts) simply call node scripts/build.js; alternatively
you can use cross-env for simple env var setting, but for computed values prefer
the Node wrapper so functions/variables in scripts/build.js (git hash capture
and spawn of Hugo) handle Windows correctly.
bindings/go/sigstore/integration/internal/trusted_root.go (2)

110-130: Same concern: hardcoded CT log URL.

The CT log base URL "http://tesseract:6962" is hardcoded. If this needs to be configurable in the future, consider adding it to TrustedRootParams alongside the public key.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/sigstore/integration/internal/trusted_root.go` around lines 110 -
130, The CT log base URL is hardcoded in buildCTLogEntries; update the
TrustedRootParams type to include a CTLogBaseURL (or similar) field and use that
value in buildCTLogEntries instead of the literal "http://tesseract:6962",
falling back to the current literal as a default when the new field is empty;
adjust any constructors or callers that build TrustedRootParams to populate
CTLogBaseURL as needed so the function uses params.CTLogBaseURL when present.

56-76: Consider parameterizing the hardcoded Fulcio URI.

The Fulcio URI is hardcoded as "http://fulcio-server:5555" while other values like RekorBaseURL are passed via TrustedRootParams. For consistency and flexibility, consider adding the Fulcio URI to the params struct.

♻️ Suggested change
 type TrustedRootParams struct {
 	FulcioRootPEM     []byte
+	FulcioBaseURL     string // base URL for Fulcio CA entry, e.g. "http://fulcio-server:5555"
 	RekorPublicKeyPEM []byte
 	RekorOrigin       string
 	RekorBaseURL      string
 	CTLogPublicKeyDER []byte
 	CTLogID           [sha256.Size]byte
 	TSACertChainPEM   []byte
 }

Then use params.FulcioBaseURL instead of the hardcoded string at line 64.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/sigstore/integration/internal/trusted_root.go` around lines 56 -
76, The trustedRoot map currently hardcodes the Fulcio URI
("http://fulcio-server:5555"); update the TrustedRootParams struct to include a
FulcioBaseURL (or similar) field and replace the literal in the trustedRoot
construction with params.FulcioBaseURL so the Fulcio endpoint is configurable;
ensure any callers constructing TrustedRootParams are updated to provide the new
FulcioBaseURL and that tests/usage that rely on the previous default are
adjusted or a sensible default is added to TrustedRootParams if needed.
bindings/go/sigstore/integration/internal/dex.go (1)

142-176: Consider using structured YAML generation instead of fmt.Sprintf.

The current approach using fmt.Sprintf with a template string works but could break if special characters appear in values (e.g., if email contained YAML-special characters). For test infrastructure with known static values this is acceptable, but a structured approach would be more robust.

♻️ Alternative using gopkg.in/yaml.v3
func generateDexConfig(issuerURL string) (string, error) {
    hash, err := bcrypt.GenerateFromPassword([]byte(dexPassword), bcrypt.DefaultCost)
    if err != nil {
        return "", err
    }

    config := map[string]any{
        "issuer": issuerURL,
        "storage": map[string]any{"type": "memory"},
        "web":     map[string]any{"http": "0.0.0.0:" + dexPort},
        "oauth2": map[string]any{
            "responseTypes":       []string{"code"},
            "skipApprovalScreen":  true,
            "passwordConnector":   "local",
        },
        "enablePasswordDB": true,
        "staticPasswords": []map[string]any{{
            "email":    dexUser,
            "hash":     string(hash),
            "username": "test-user",
            "userID":   "test-user-id",
        }},
        "staticClients": []map[string]any{{
            "id":           dexClientID,
            "public":       true,
            "name":         "Fulcio",
            "redirectURIs": []string{"http://localhost/callback"},
        }},
    }

    data, err := yaml.Marshal(config)
    if err != nil {
        return "", err
    }
    return string(data), nil
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/sigstore/integration/internal/dex.go` around lines 142 - 176, The
generateDexConfig function builds YAML via fmt.Sprintf which can produce invalid
YAML if values contain special characters; instead construct a typed Go
structure or map (referencing generateDexConfig, dexPassword, dexPort, dexUser,
dexClientID) and use gopkg.in/yaml.v3 (yaml.Marshal) to serialize it; keep the
bcrypt-generated hash (string(hash)) in the staticPasswords entry, set web.http
to "0.0.0.0:"+dexPort, oauth2 and other nested keys as maps/slices as in the
review example, handle and return marshal errors, and remove the fmt.Sprintf
template.
bindings/go/sigstore/integration/internal/fulcio.go (1)

203-208: Clarify the intent of the empty --ct-log-url= flag.

When ctLogURL is empty, the code explicitly passes --ct-log-url= with an empty value. This differs from simply omitting the flag entirely. If the intent is to disable CT logging, consider adding a brief comment explaining why the empty flag is needed versus omitting it.

📝 Suggested documentation
 func fulcioCmd(ctLogURL string) []string {
 	cmd := []string{
 		"serve",
 		"--host=0.0.0.0",
 		"--port=" + fulcioPort,
 		"--grpc-port=" + fulcioGRPCPort,
 		"--ca=fileca",
 		"--fileca-cert=/etc/fulcio/root.pem",
 		"--fileca-key=/etc/fulcio/root.key",
 		"--fileca-key-passwd=" + fulcioKeyPw,
 		"--config-path=/etc/fulcio/config.json",
 	}
 	if ctLogURL != "" {
 		cmd = append(cmd, "--ct-log-url="+ctLogURL)
 	} else {
+		// Explicitly set empty --ct-log-url to disable CT log submission;
+		// omitting the flag entirely may cause Fulcio to use a default.
 		cmd = append(cmd, "--ct-log-url=")
 	}
 	return cmd
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/sigstore/integration/internal/fulcio.go` around lines 203 - 208,
The code appends an explicit "--ct-log-url=" when ctLogURL is empty, which is
different from omitting the flag; update the logic in the command-building code
that uses ctLogURL (the branch that currently does cmd = append(cmd,
"--ct-log-url="+ctLogURL) / cmd = append(cmd, "--ct-log-url=")) to make intent
explicit: either remove the else branch and do not append the flag when ctLogURL
== "" (if omission should disable CT logging), or keep the else branch but add a
concise comment above it explaining why an empty "--ct-log-url=" must be passed
to disable/override CT logging behavior; ensure the change touches the code path
that constructs cmd and adjust any related tests or caller expectations
accordingly.
cli/internal/oidcflow/oidcflow.go (3)

223-232: PKCE S256 requirement may reject valid providers.

Some OIDC providers support PKCE but don't advertise code_challenge_methods_supported in their discovery document (it's optional per RFC 8414). This check will fail for such providers even if they accept S256 challenges.

Consider either:

  1. Attempting PKCE anyway if the claim is absent (many providers accept it)
  2. Making PKCE optional with a fallback

However, for Sigstore's public-good infrastructure this is likely fine since it does advertise S256.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/internal/oidcflow/oidcflow.go` around lines 223 - 232, The current loop
in oidcflow.go rejects providers when claims.Methods does not include "S256",
but RFC 8414 makes code_challenge_methods_supported optional; update the logic
in the PKCE support check to treat an absent or empty claims.Methods as
"unknown" and either attempt S256 anyway or fall back to non-PKCE flow: modify
the block that inspects claims.Methods (the supported boolean check over
claims.Methods) to: if claims.Methods is empty, proceed with attempting PKCE
S256, and only error using provider.Endpoint().AuthURL when Methods is present
and explicitly does not contain "S256" (or implement a fallback branch that
continues without PKCE when S256 is not supported).

129-129: oidc.Nonce is an auth URL option, not a token exchange option.

The oidc.Nonce(nonce) is designed for the authorization URL (which you correctly use at line 116). Passing it to config.Exchange() has no effect because the token endpoint doesn't accept a nonce parameter—the nonce is embedded in the ID token by the IdP based on the auth request.

🔧 Remove ineffective nonce from Exchange call
-	token, err := config.Exchange(ctx, code, append(pkce.tokenURLOpts(), oidc.Nonce(nonce))...)
+	token, err := config.Exchange(ctx, code, pkce.tokenURLOpts()...)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/internal/oidcflow/oidcflow.go` at line 129, Remove the ineffective
oidc.Nonce(nonce) option from the token exchange call: in the line with token,
err := config.Exchange(ctx, code, append(pkce.tokenURLOpts(),
oidc.Nonce(nonce))...), stop appending oidc.Nonce(nonce) and only pass
pkce.tokenURLOpts() (and any real token endpoint options if needed); the nonce
belongs on the authorization URL (as already used when building the auth
request) and should not be sent to config.Exchange().

91-92: Type assertion could panic if listener address is not TCP.

The type assertion listener.Addr().(*net.TCPAddr) will panic if the listener isn't TCP-based. While net.Listen("tcp", ...) should always return a TCP listener, a defensive check would be safer.

🛡️ Defensive type assertion
-	addr := listener.Addr().(*net.TCPAddr)
+	addr, ok := listener.Addr().(*net.TCPAddr)
+	if !ok {
+		listener.Close()
+		return nil, errors.New("listener address is not TCP")
+	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/internal/oidcflow/oidcflow.go` around lines 91 - 92, The code currently
uses a direct type assertion listener.Addr().(*net.TCPAddr) which can panic if
the listener address is not a *net.TCPAddr; update the logic in the oidc flow to
use the safe "addr, ok := listener.Addr().(*net.TCPAddr)" pattern and handle the
fallback case (e.g., parse listener.Addr().String() to extract the port or
return a clear error) before forming redirectURL :=
fmt.Sprintf("http://localhost:%d%s", addr.Port, callbackPath); ensure references
to listener.Addr(), the addr variable, redirectURL and callbackPath are updated
accordingly so non-TCP addresses are handled defensively.
bindings/go/sigstore/integration/internal/ctlog.go (1)

77-80: Consider restricting private key file mode in container mount.

The private key is correctly written to disk with 0o600 (line 61), but is mounted into the container with 0o644 (line 78). While this is an ephemeral test key in an isolated container, using 0o600 for the container mount would be more consistent with security best practices.

🔧 Suggested change
 			Files: []testcontainers.ContainerFile{
-				{HostFilePath: keyPath, ContainerFilePath: "/etc/ctfe/privkey.pem", FileMode: 0o644},
+				{HostFilePath: keyPath, ContainerFilePath: "/etc/ctfe/privkey.pem", FileMode: 0o600},
 				{HostFilePath: fulcioRootCertPath, ContainerFilePath: "/etc/fulcio/root.pem", FileMode: 0o644},
 			},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/sigstore/integration/internal/ctlog.go` around lines 77 - 80,
Change the mounted private key file permission to be more restrictive: in the
Files slice where the container mount is defined (the ContainerFile entry that
uses keyPath and ContainerFilePath "/etc/ctfe/privkey.pem"), update its FileMode
from 0o644 to 0o600 so the key inside the container matches the on-disk
permission used when writing the key.
bindings/go/sigstore/signing/handler/cosign.go (1)

66-92: Permanent caching of download failure may hinder recovery.

When ensureOrDownloadCosign() fails (e.g., due to transient network issues), the error is cached permanently in checkErr. The documentation at lines 70-72 acknowledges this and suggests creating a new DefaultExecutor to retry.

This is a reasonable trade-off for simplicity, but consider whether a time-based retry or explicit reset mechanism would improve UX for long-running processes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/sigstore/signing/handler/cosign.go` around lines 66 - 92, The
current ensureCosignAvailable method permanently caches download failures in
DefaultExecutor.checkErr (set inside checkOnce) when ensureOrDownloadCosign()
fails, preventing retries; add a safe retry/reset mechanism: implement either a
time-based retry or an explicit Reset/Refresh method on DefaultExecutor that
clears checkErr and reinitializes checkOnce so callers can trigger a retry
without constructing a new DefaultExecutor, and update New()/documentation to
mention the new API; locate the logic in ensureCosignAvailable and the fields
checkOnce/checkErr and ensureOrDownloadCosign to make the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bindings/go/sigstore/integration/go.mod`:
- Line 29: The indirect dependency github.com/docker/docker pinned to v28.5.2 in
integration module go.mod files is vulnerable; update the integration modules
(the go.mod files referenced by bindings/go/oci/integration and
bindings/go/transfer/integration) to explicitly override
github.com/docker/docker to v29.3.1 or later using a go.mod replace/require
directive so tests use the patched Docker client even though testcontainers-go
v0.41.0 hasn’t been updated; ensure the override references
github.com/docker/docker at v29.3.1+ and keep the rest of module requirements
intact.

---

Nitpick comments:
In `@bindings/go/sigstore/integration/internal/ctlog.go`:
- Around line 77-80: Change the mounted private key file permission to be more
restrictive: in the Files slice where the container mount is defined (the
ContainerFile entry that uses keyPath and ContainerFilePath
"/etc/ctfe/privkey.pem"), update its FileMode from 0o644 to 0o600 so the key
inside the container matches the on-disk permission used when writing the key.

In `@bindings/go/sigstore/integration/internal/dex.go`:
- Around line 142-176: The generateDexConfig function builds YAML via
fmt.Sprintf which can produce invalid YAML if values contain special characters;
instead construct a typed Go structure or map (referencing generateDexConfig,
dexPassword, dexPort, dexUser, dexClientID) and use gopkg.in/yaml.v3
(yaml.Marshal) to serialize it; keep the bcrypt-generated hash (string(hash)) in
the staticPasswords entry, set web.http to "0.0.0.0:"+dexPort, oauth2 and other
nested keys as maps/slices as in the review example, handle and return marshal
errors, and remove the fmt.Sprintf template.

In `@bindings/go/sigstore/integration/internal/fulcio.go`:
- Around line 203-208: The code appends an explicit "--ct-log-url=" when
ctLogURL is empty, which is different from omitting the flag; update the logic
in the command-building code that uses ctLogURL (the branch that currently does
cmd = append(cmd, "--ct-log-url="+ctLogURL) / cmd = append(cmd,
"--ct-log-url=")) to make intent explicit: either remove the else branch and do
not append the flag when ctLogURL == "" (if omission should disable CT logging),
or keep the else branch but add a concise comment above it explaining why an
empty "--ct-log-url=" must be passed to disable/override CT logging behavior;
ensure the change touches the code path that constructs cmd and adjust any
related tests or caller expectations accordingly.

In `@bindings/go/sigstore/integration/internal/trusted_root.go`:
- Around line 110-130: The CT log base URL is hardcoded in buildCTLogEntries;
update the TrustedRootParams type to include a CTLogBaseURL (or similar) field
and use that value in buildCTLogEntries instead of the literal
"http://tesseract:6962", falling back to the current literal as a default when
the new field is empty; adjust any constructors or callers that build
TrustedRootParams to populate CTLogBaseURL as needed so the function uses
params.CTLogBaseURL when present.
- Around line 56-76: The trustedRoot map currently hardcodes the Fulcio URI
("http://fulcio-server:5555"); update the TrustedRootParams struct to include a
FulcioBaseURL (or similar) field and replace the literal in the trustedRoot
construction with params.FulcioBaseURL so the Fulcio endpoint is configurable;
ensure any callers constructing TrustedRootParams are updated to provide the new
FulcioBaseURL and that tests/usage that rely on the previous default are
adjusted or a sensible default is added to TrustedRootParams if needed.

In `@bindings/go/sigstore/signing/handler/cosign.go`:
- Around line 66-92: The current ensureCosignAvailable method permanently caches
download failures in DefaultExecutor.checkErr (set inside checkOnce) when
ensureOrDownloadCosign() fails, preventing retries; add a safe retry/reset
mechanism: implement either a time-based retry or an explicit Reset/Refresh
method on DefaultExecutor that clears checkErr and reinitializes checkOnce so
callers can trigger a retry without constructing a new DefaultExecutor, and
update New()/documentation to mention the new API; locate the logic in
ensureCosignAvailable and the fields checkOnce/checkErr and
ensureOrDownloadCosign to make the change.

In `@cli/internal/oidcflow/oidcflow.go`:
- Around line 223-232: The current loop in oidcflow.go rejects providers when
claims.Methods does not include "S256", but RFC 8414 makes
code_challenge_methods_supported optional; update the logic in the PKCE support
check to treat an absent or empty claims.Methods as "unknown" and either attempt
S256 anyway or fall back to non-PKCE flow: modify the block that inspects
claims.Methods (the supported boolean check over claims.Methods) to: if
claims.Methods is empty, proceed with attempting PKCE S256, and only error using
provider.Endpoint().AuthURL when Methods is present and explicitly does not
contain "S256" (or implement a fallback branch that continues without PKCE when
S256 is not supported).
- Line 129: Remove the ineffective oidc.Nonce(nonce) option from the token
exchange call: in the line with token, err := config.Exchange(ctx, code,
append(pkce.tokenURLOpts(), oidc.Nonce(nonce))...), stop appending
oidc.Nonce(nonce) and only pass pkce.tokenURLOpts() (and any real token endpoint
options if needed); the nonce belongs on the authorization URL (as already used
when building the auth request) and should not be sent to config.Exchange().
- Around line 91-92: The code currently uses a direct type assertion
listener.Addr().(*net.TCPAddr) which can panic if the listener address is not a
*net.TCPAddr; update the logic in the oidc flow to use the safe "addr, ok :=
listener.Addr().(*net.TCPAddr)" pattern and handle the fallback case (e.g.,
parse listener.Addr().String() to extract the port or return a clear error)
before forming redirectURL := fmt.Sprintf("http://localhost:%d%s", addr.Port,
callbackPath); ensure references to listener.Addr(), the addr variable,
redirectURL and callbackPath are updated accordingly so non-TCP addresses are
handled defensively.

In `@website/package.json`:
- Line 8: The npm scripts in package.json (notably the "build" script and the
other scripts using VAR=$(...) syntax) use POSIX-only variable-substitution
which breaks on Windows; replace them with a cross-platform approach by creating
a small Node wrapper (e.g., scripts/build.js) that runs git to compute commit
hashes via child_process, sets HUGO_PARAMS_COMMITFULL and
HUGO_PARAMS_COMMITSHORT on process.env, and then spawns the Hugo binary
(./node_modules/.bin/hugo) so package.json's "build" (and the other offending
scripts) simply call node scripts/build.js; alternatively you can use cross-env
for simple env var setting, but for computed values prefer the Node wrapper so
functions/variables in scripts/build.js (git hash capture and spawn of Hugo)
handle Windows correctly.
🪄 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: 50aeb7d4-1bc8-4459-b230-322882d0964e

📥 Commits

Reviewing files that changed from the base of the PR and between 351735d and 877629c.

⛔ Files ignored due to path filters (4)
  • bindings/go/sigstore/go.sum is excluded by !**/*.sum
  • bindings/go/sigstore/integration/go.sum is excluded by !**/*.sum
  • cli/go.sum is excluded by !**/*.sum
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (50)
  • .github/config/wordlist.txt
  • .github/renovate.json5
  • Taskfile.yml
  • bindings/go/sigstore/Taskfile.yml
  • bindings/go/sigstore/doc.go
  • bindings/go/sigstore/go.mod
  • bindings/go/sigstore/integration/Taskfile.yml
  • bindings/go/sigstore/integration/go.mod
  • bindings/go/sigstore/integration/integration_test.go
  • bindings/go/sigstore/integration/internal/ctlog.go
  • bindings/go/sigstore/integration/internal/dex.go
  • bindings/go/sigstore/integration/internal/fulcio.go
  • bindings/go/sigstore/integration/internal/rekor.go
  • bindings/go/sigstore/integration/internal/signing_config.go
  • bindings/go/sigstore/integration/internal/stack.go
  • bindings/go/sigstore/integration/internal/trusted_root.go
  • bindings/go/sigstore/integration/internal/tsa.go
  • bindings/go/sigstore/signing/handler/config_test.go
  • bindings/go/sigstore/signing/handler/cosign.go
  • bindings/go/sigstore/signing/handler/cosign_download.go
  • bindings/go/sigstore/signing/handler/cosign_download_test.go
  • bindings/go/sigstore/signing/handler/cosign_version.go
  • bindings/go/sigstore/signing/handler/handler.go
  • bindings/go/sigstore/signing/handler/handler_test.go
  • bindings/go/sigstore/signing/handler/resolve.go
  • bindings/go/sigstore/signing/handler/sign.go
  • bindings/go/sigstore/signing/handler/sign_test.go
  • bindings/go/sigstore/signing/handler/verify.go
  • bindings/go/sigstore/signing/handler/verify_test.go
  • bindings/go/sigstore/signing/v1alpha1/algorithm.go
  • bindings/go/sigstore/signing/v1alpha1/config.go
  • bindings/go/sigstore/signing/v1alpha1/group_version.go
  • bindings/go/sigstore/signing/v1alpha1/oidc_identity_token.go
  • bindings/go/sigstore/signing/v1alpha1/trusted_root_identity.go
  • bindings/go/sigstore/signing/v1alpha1/zz_generated.deepcopy.go
  • cli/cmd/cmd_test.go
  • cli/cmd/setup/setup.go
  • cli/cmd/sign/component-version/cmd.go
  • cli/cmd/verify/component-version/cmd.go
  • cli/docs/reference/ocm_sign_component-version.md
  • cli/docs/reference/ocm_verify_component-version.md
  • cli/go.mod
  • cli/internal/oidcflow/oidcflow.go
  • cli/internal/oidcflow/oidcflow_test.go
  • cli/internal/plugin/builtin/builtin.go
  • cli/internal/plugin/builtin/cosign/oidc_plugin.go
  • cli/internal/plugin/builtin/cosign/oidc_plugin_test.go
  • cli/internal/plugin/builtin/cosign/register.go
  • website/layouts/_partials/footer/footer.html
  • website/package.json

Comment thread bindings/go/sigstore/integration/go.mod Outdated
@jakobmoellerdev jakobmoellerdev merged commit 0236bb8 into open-component-model:main Apr 15, 2026
25 checks passed
ocmbot Bot pushed a commit that referenced this pull request Apr 15, 2026
## Summary
- Inject git commit hash (scoped to `website/` folder) as Hugo params at
build time via `HUGO_PARAMS_COMMITFULL` / `HUGO_PARAMS_COMMITSHORT` env
vars
- Display clickable "Commit abc1234" link in homepage footer below
Netlify icon
- Link URL uses `site.docsRepo` config — no hardcoded repo URL
- Graceful fallback: nothing rendered when env vars absent

Closes open-component-model/ocm-project#1017

Link will only work for the first time once merge to the monorepo.

## Test plan
- [ ] Run `npm run build` in `website/`, verify commit hash appears in
footer HTML
- [ ] Run `npm run dev`, check footer shows commit link on homepage
- [ ] Verify link points to correct GitHub commit URL
- [ ] Build without env vars (run `hugo` directly) — confirm no commit
shown

---------

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> 0236bb8
@frewilhelm

Copy link
Copy Markdown
Contributor

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/s Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add latest commit hash to website footer

5 participants