Add mutation for adding digest to image spec

This commit is contained in:
Jonny Stoten
2024-06-20 12:25:04 +01:00
parent 0e3d5b5911
commit 3378c90b3f
8 changed files with 138 additions and 30 deletions

17
pkg/handler/tuf.go Normal file
View File

@@ -0,0 +1,17 @@
package handler
import (
"github.com/docker/attest/pkg/tuf"
"github.com/open-policy-agent/gatekeeper-external-data-provider/internal/embed"
)
func createTufClient(outputPath string) (*tuf.TufClient, error) {
// using oci tuf metadata and targets
// metadataURI := "registry-1.docker.io/docker/tuf-metadata:latest"
// targetsURI := "registry-1.docker.io/docker/tuf-targets"
// example using http tuf metadata and targets
metadataURI := "https://docker.github.io/tuf-staging/metadata"
targetsURI := "https://docker.github.io/tuf-staging/targets"
return tuf.NewTufClient(embed.StagingRoot, outputPath, metadataURI, targetsURI, tuf.NewVersionChecker())
}