feat: add exported constants

This commit is contained in:
mrjoelkamp
2024-04-22 12:47:14 -05:00
parent a3422b5331
commit 1813ab8a7a
3 changed files with 10 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/containerd/containerd/platforms"
"github.com/distribution/reference"
att "github.com/docker/attest/pkg/attestation"
"github.com/docker/attest/pkg/types"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
@@ -71,11 +72,11 @@ func attestationManifestFromOCILayout(path string, platformStr string) (*Attesta
}
}
for _, mf := range mfs2.Manifests {
if mf.Annotations[DockerReferenceType] != AttestationManifestType {
if mf.Annotations[types.DockerReferenceType] != types.AttestationManifestType {
continue
}
if mf.Annotations[DockerReferenceDigest] != imageDigest {
if mf.Annotations[types.DockerReferenceDigest] != imageDigest {
continue
}

View File

@@ -1,8 +1,5 @@
package oci
const (
DockerReferenceType = "vnd.docker.reference.type"
DockerReferenceDigest = "vnd.docker.reference.digest"
AttestationManifestType = "attestation-manifest"
InTotoPredicateType = "in-toto.io/predicate-type"
)

7
pkg/types/types.go Normal file
View File

@@ -0,0 +1,7 @@
package types
const (
DockerReferenceType = "vnd.docker.reference.type"
DockerReferenceDigest = "vnd.docker.reference.digest"
AttestationManifestType = "attestation-manifest"
)