Skip to content

Commit

Permalink
update(sign): package name sign -> signature
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
Co-authored-by: Carlos Panato <[email protected]>
  • Loading branch information
2 people authored and poiana committed Jul 7, 2023
1 parent 8440ac9 commit 5e6ce83
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cmd/artifact/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cosign/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions internal/follower/follower.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/sign/doc.go → internal/signature/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions internal/sign/sign.go → internal/signature/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package sign
package signature

import (
"context"
Expand All @@ -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
Expand Down

0 comments on commit 5e6ce83

Please sign in to comment.