Skip to content

Commit

Permalink
remove Verify in favor of explicit `VerifyImage{Signatures, Attesta…
Browse files Browse the repository at this point in the history
…tions}`

Signed-off-by: Jake Sanders <[email protected]>
  • Loading branch information
Jake Sanders committed Nov 10, 2021
1 parent cb41bd4 commit 38840cc
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 127 deletions.
2 changes: 1 addition & 1 deletion cmd/cosign/cli/verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c *VerifyCommand) Exec(ctx context.Context, images []string) (err error) {
return errors.Wrapf(err, "resolving attachment type %s for image %s", c.Attachment, img)
}

verified, bundleVerified, err := cosign.VerifySignatures(ctx, ref, co)
verified, bundleVerified, err := cosign.VerifyImageSignatures(ctx, ref, co)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cosign/cli/verify/verify_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (c *VerifyAttestationCommand) Exec(ctx context.Context, images []string) (e
return err
}

verified, bundleVerified, err := cosign.VerifyAttestations(ctx, ref, co)
verified, bundleVerified, err := cosign.VerifyImageAttestations(ctx, ref, co)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cosign/kubernetes/webhook/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func valid(ctx context.Context, ref name.Reference, keys []*ecdsa.PublicKey, opt
}

// For testing
var cosignVerifySignatures = cosign.VerifySignatures
var cosignVerifySignatures = cosign.VerifyImageSignatures

func validSignatures(ctx context.Context, ref name.Reference, verifier signature.Verifier, opts ...ociremote.Option) ([]oci.Signature, error) {
sigs, _, err := cosignVerifySignatures(ctx, ref, &cosign.CheckOpts{
Expand Down
Loading

0 comments on commit 38840cc

Please sign in to comment.