From 8ab5f247aff3fe65a1864d2fd9d6aba704b7769e Mon Sep 17 00:00:00 2001 From: Meredith Lancaster Date: Thu, 7 Nov 2024 14:47:53 -0700 Subject: [PATCH] rename type Signed-off-by: Meredith Lancaster --- pkg/cmd/attestation/download/download.go | 2 +- pkg/cmd/attestation/verification/attestation.go | 4 ++-- pkg/cmd/attestation/verify/attestation.go | 2 +- pkg/cmd/attestation/verify/verify.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/attestation/download/download.go b/pkg/cmd/attestation/download/download.go index 77c928093..ef5a11799 100644 --- a/pkg/cmd/attestation/download/download.go +++ b/pkg/cmd/attestation/download/download.go @@ -122,7 +122,7 @@ func runDownload(opts *Options) error { opts.Logger.VerbosePrintf("Downloading trusted metadata for artifact %s\n\n", opts.ArtifactPath) - c := verification.FetchAttestationsConfig{ + c := verification.FetchRemoteAttestations{ APIClient: opts.APIClient, Digest: artifact.DigestWithAlg(), Limit: opts.Limit, diff --git a/pkg/cmd/attestation/verification/attestation.go b/pkg/cmd/attestation/verification/attestation.go index dd885a1c1..bdee3a014 100644 --- a/pkg/cmd/attestation/verification/attestation.go +++ b/pkg/cmd/attestation/verification/attestation.go @@ -20,7 +20,7 @@ const SLSAPredicateV1 = "https://slsa.dev/provenance/v1" var ErrUnrecognisedBundleExtension = errors.New("bundle file extension not supported, must be json or jsonl") var ErrEmptyBundleFile = errors.New("provided bundle file is empty") -type FetchAttestationsConfig struct { +type FetchRemoteAttestations struct { APIClient api.Client Digest string Limit int @@ -96,7 +96,7 @@ func loadBundlesFromJSONLinesFile(path string) ([]*api.Attestation, error) { return attestations, nil } -func GetRemoteAttestations(c FetchAttestationsConfig) ([]*api.Attestation, error) { +func GetRemoteAttestations(c FetchRemoteAttestations) ([]*api.Attestation, error) { if c.APIClient == nil { return nil, fmt.Errorf("api client must be provided") } diff --git a/pkg/cmd/attestation/verify/attestation.go b/pkg/cmd/attestation/verify/attestation.go index a588d9764..483d4cf97 100644 --- a/pkg/cmd/attestation/verify/attestation.go +++ b/pkg/cmd/attestation/verify/attestation.go @@ -32,7 +32,7 @@ func getAttestations(o *Options, a artifact.DigestedArtifact) ([]*api.Attestatio return attestations, msg, nil } - c := verification.FetchAttestationsConfig{ + c := verification.FetchRemoteAttestations{ APIClient: o.APIClient, Digest: a.DigestWithAlg(), Limit: o.Limit, diff --git a/pkg/cmd/attestation/verify/verify.go b/pkg/cmd/attestation/verify/verify.go index e5dd12f59..90149f7ca 100644 --- a/pkg/cmd/attestation/verify/verify.go +++ b/pkg/cmd/attestation/verify/verify.go @@ -227,7 +227,7 @@ func runVerify(opts *Options) error { opts.Logger.Printf(opts.Logger.ColorScheme.Red("✗ No attestations found for subject %s\n"), artifact.DigestWithAlg()) return err } - + // Print the message signifying failure fetching attestations opts.Logger.Printf(opts.Logger.ColorScheme.Red(logMsg)) return err }