fix: verify mapped image name against subjects (#156)

* fix: verify mapped image name against subjects
This commit is contained in:
James Carnegie
2024-09-05 14:08:55 +01:00
committed by GitHub
parent a363be7f3a
commit ed0ae8ecf6
10 changed files with 195 additions and 8 deletions

View File

@@ -1,8 +1,10 @@
package attest
import (
"context"
"fmt"
"github.com/docker/attest/attestation"
"github.com/docker/attest/policy"
v1 "github.com/google/go-containerregistry/pkg/v1"
intoto "github.com/in-toto/in-toto-golang/in_toto"
@@ -35,3 +37,12 @@ type VerificationResult struct {
Violations []policy.Violation
SubjectDescriptor *v1.Descriptor
}
type wrappedResolver struct {
imageName string
attestation.Resolver
}
func (w *wrappedResolver) ImageName(_ context.Context) (string, error) {
return w.imageName, nil
}