Skip to content

fix(provenance): use repo-scoped attestation endpoint#612

Merged
andresmgot merged 1 commit into
mainfrom
fix/provenance-org-attestation-endpoint
Jun 10, 2026
Merged

fix(provenance): use repo-scoped attestation endpoint#612
andresmgot merged 1 commit into
mainfrom
fix/provenance-org-attestation-endpoint

Conversation

@andresmgot

@andresmgot andresmgot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The provenance attestation check fails for plugins published under a GitHub organization, even when the plugin was correctly built with provenance attestation.

The check queried the user-scoped attestations endpoint:

GET /users/{owner}/attestations/sha256:{digest}

This endpoint only returns attestations for repositories owned by a user account. For organization-owned repositories it returns 404, so the validator reported a false invalid-provenance-attestation.

This switches to the repository-scoped endpoint, which works for both user- and organization-owned repositories:

GET /repos/{owner}/{repo}/attestations/sha256:{digest}

The repo name is already captured by the existing source-code-reference regex (matches[2]), so it's just threaded through to the request.

Example

kineticadb/grafana-kinetica-datasource v1.0.5 (org-owned, correctly attested) was failing the check:

  • GET /users/kineticadb/attestations/sha256:<zip-digest> → 404 (false failure)
  • GET /repos/kineticadb/grafana-kinetica-datasource/attestations/sha256:<zip-digest> → 200 (attestation found, digest matches)

This affected effectively all plugins published under a GitHub org (most vendor plugins); only personal-account repositories worked before.

The provenance check queried the user-scoped GitHub attestations endpoint
(/users/{owner}/attestations), which only returns attestations for
repositories owned by a user account. For organization-owned repositories
this returns 404, causing false "invalid-provenance-attestation" failures
even when the artifact was correctly attested.

Switch to the repository-scoped endpoint
(/repos/{owner}/{repo}/attestations), which works for both user- and
organization-owned repositories.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-project-automation github-project-automation Bot moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team Jun 10, 2026
@andresmgot andresmgot merged commit 79811ac into main Jun 10, 2026
11 checks passed
@andresmgot andresmgot deleted the fix/provenance-org-attestation-endpoint branch June 10, 2026 09:52
@github-project-automation github-project-automation Bot moved this from 🔬 In review to 🚀 Shipped in Grafana Catalog Team Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚀 Shipped

Development

Successfully merging this pull request may close these issues.

2 participants