From 5e6ce83dedba6e3192ca09b57d4b71b2a45293a0 Mon Sep 17 00:00:00 2001 From: Luca Guerra Date: Thu, 6 Jul 2023 15:39:44 +0200 Subject: [PATCH] update(sign): package name sign -> signature Signed-off-by: Luca Guerra Co-authored-by: Carlos Panato --- cmd/artifact/install/install.go | 4 ++-- internal/cosign/doc.go | 2 +- internal/follower/follower.go | 4 ++-- internal/{sign => signature}/doc.go | 4 ++-- internal/{sign/sign.go => signature/signature.go} | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) rename internal/{sign => signature}/doc.go (86%) rename internal/{sign/sign.go => signature/signature.go} (86%) diff --git a/cmd/artifact/install/install.go b/cmd/artifact/install/install.go index 3d9fa0b6..3d4aeaf0 100644 --- a/cmd/artifact/install/install.go +++ b/cmd/artifact/install/install.go @@ -25,7 +25,7 @@ import ( "github.com/spf13/viper" "github.com/falcosecurity/falcoctl/internal/config" - "github.com/falcosecurity/falcoctl/internal/sign" + "github.com/falcosecurity/falcoctl/internal/signature" "github.com/falcosecurity/falcoctl/internal/utils" "github.com/falcosecurity/falcoctl/pkg/index" "github.com/falcosecurity/falcoctl/pkg/oci" @@ -290,7 +290,7 @@ func (o *artifactInstallOptions) RunArtifactInstall(ctx context.Context, args [] digestRef := fmt.Sprintf("%s@%s", repo, result.RootDigest) o.Printer.Info.Printfln("Verifying signature for %s", digestRef) - err = sign.VerifySignature(ctx, digestRef, sig) + err = signature.Verify(ctx, digestRef, sig) if err != nil { return fmt.Errorf("error while verifying signature for %s: %w", digestRef, err) } diff --git a/internal/cosign/doc.go b/internal/cosign/doc.go index aaeb494a..f2e0f4a3 100644 --- a/internal/cosign/doc.go +++ b/internal/cosign/doc.go @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package cosign contains all cosign specific functions. It should not be called directly but only through the sign package +// Package cosign contains all cosign specific functions. It should not be called directly but only through the signature package package cosign diff --git a/internal/follower/follower.go b/internal/follower/follower.go index 55d0980e..c5235a8d 100644 --- a/internal/follower/follower.go +++ b/internal/follower/follower.go @@ -32,7 +32,7 @@ import ( "oras.land/oras-go/v2/registry" "github.com/falcosecurity/falcoctl/internal/config" - "github.com/falcosecurity/falcoctl/internal/sign" + "github.com/falcosecurity/falcoctl/internal/signature" "github.com/falcosecurity/falcoctl/internal/utils" "github.com/falcosecurity/falcoctl/pkg/index" "github.com/falcosecurity/falcoctl/pkg/oci" @@ -265,7 +265,7 @@ func (f *Follower) pull(ctx context.Context) (filePaths []string, res *oci.Regis // Verify the signature if needed if f.Config.Signature != nil { f.Verbosef("verifying signature") - err = sign.VerifySignature(ctx, res.RootDigest, f.Config.Signature) + err = signature.Verify(ctx, res.RootDigest, f.Config.Signature) if err != nil { return filePaths, res, fmt.Errorf("could not verify signature for %s: %w", res.RootDigest, err) } diff --git a/internal/sign/doc.go b/internal/signature/doc.go similarity index 86% rename from internal/sign/doc.go rename to internal/signature/doc.go index d44d8868..ca053aa6 100644 --- a/internal/sign/doc.go +++ b/internal/signature/doc.go @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package sign allows falcoctl to interpret signature data and verify it -package sign +// Package signature allows falcoctl to interpret signature data and verify it +package signature diff --git a/internal/sign/sign.go b/internal/signature/signature.go similarity index 86% rename from internal/sign/sign.go rename to internal/signature/signature.go index a66fc666..80d7ef9c 100644 --- a/internal/sign/sign.go +++ b/internal/signature/signature.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sign +package signature import ( "context" @@ -23,8 +23,8 @@ import ( "github.com/falcosecurity/falcoctl/pkg/index" ) -// VerifySignature checks that a fully qualified reference is signed according to the parameters. -func VerifySignature(ctx context.Context, ref string, signature *index.Signature) error { +// Verify checks that a fully qualified reference is signed according to the parameters. +func Verify(ctx context.Context, ref string, signature *index.Signature) error { if signature == nil { // nothing to do return nil