fix: verify mapped image name against subjects (#156)
* fix: verify mapped image name against subjects
This commit is contained in:
11
types.go
11
types.go
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user