mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-22 19:57:44 +08:00

- drops the replace-rule for github.com/aws/aws-sdk-go-v2/config (as it no longer was replacing anything)
- drops the replace-rules for docker/cli and docker/docker (at least as long as we continue using tagged releases)
- removes the github.com/docker/docker/pkg/stringid package (which was redundant)
full diff: 9624ab4710..5993b526de
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
57 lines
1.0 KiB
Go
57 lines
1.0 KiB
Go
package result
|
|
|
|
import (
|
|
pb "github.com/moby/buildkit/frontend/gateway/pb"
|
|
digest "github.com/opencontainers/go-digest"
|
|
)
|
|
|
|
const (
|
|
AttestationReasonKey = "reason"
|
|
AttestationInlineOnlyKey = "inline-only"
|
|
)
|
|
|
|
var (
|
|
AttestationReasonSBOM = []byte("sbom")
|
|
AttestationReasonProvenance = []byte("provenance")
|
|
)
|
|
|
|
type Attestation struct {
|
|
Kind pb.AttestationKind
|
|
|
|
Metadata map[string][]byte
|
|
|
|
Ref string
|
|
Path string
|
|
ContentFunc func() ([]byte, error)
|
|
|
|
InToto InTotoAttestation
|
|
}
|
|
|
|
type InTotoAttestation struct {
|
|
PredicateType string
|
|
Subjects []InTotoSubject
|
|
}
|
|
|
|
type InTotoSubject struct {
|
|
Kind pb.InTotoSubjectKind
|
|
|
|
Name string
|
|
Digest []digest.Digest
|
|
}
|
|
|
|
func ToDigestMap(ds ...digest.Digest) map[string]string {
|
|
m := map[string]string{}
|
|
for _, d := range ds {
|
|
m[d.Algorithm().String()] = d.Encoded()
|
|
}
|
|
return m
|
|
}
|
|
|
|
func FromDigestMap(m map[string]string) []digest.Digest {
|
|
var ds []digest.Digest
|
|
for k, v := range m {
|
|
ds = append(ds, digest.NewDigestFromEncoded(digest.Algorithm(k), v))
|
|
}
|
|
return ds
|
|
}
|