@@ -2,13 +2,14 @@ package commands
22
33import (
44 "fmt"
5+ "strings"
6+
57 precommit "github.com/Checkmarx/secret-detection/pkg/hooks"
68 "github.com/MakeNowJust/heredoc"
79 "github.com/checkmarx/ast-cli/internal/params"
810 "github.com/checkmarx/ast-cli/internal/wrappers"
911 "github.com/pkg/errors"
1012 "github.com/spf13/cobra"
11- "strings"
1213)
1314
1415// NewHooksCommand creates the hooks command with pre-commit subcommand
@@ -63,9 +64,8 @@ func PreCommitCommand(jwtWrapper wrappers.JWTWrapper) *cobra.Command {
6364 return preCommitCmd
6465}
6566
66- // / validateLicense verifies the user has the required license for secret detection
67- func validateLicense (jwtWrapper wrappers.JWTWrapper ) error {
68-
67+ // ValidateLicense verifies the user has the required license for secret detection
68+ func ValidateLicense (jwtWrapper wrappers.JWTWrapper ) error {
6969 allowed , err := jwtWrapper .IsAllowedEngine (params .EnterpriseSecretsLabel )
7070 if err != nil {
7171 return errors .Wrapf (err , "Failed checking license" )
@@ -87,7 +87,7 @@ func secretsInstallGitHookCommand(jwtWrapper wrappers.JWTWrapper) *cobra.Command
8787 ` ,
8888 ),
8989 PreRunE : func (cmd * cobra.Command , args []string ) error {
90- return validateLicense (jwtWrapper )
90+ return ValidateLicense (jwtWrapper )
9191 },
9292 RunE : func (cmd * cobra.Command , args []string ) error {
9393 global , _ := cmd .Flags ().GetBool ("global" )
@@ -128,7 +128,7 @@ func secretsUpdateGitHookCommand(jwtWrapper wrappers.JWTWrapper) *cobra.Command
128128 ` ,
129129 ),
130130 PreRunE : func (cmd * cobra.Command , args []string ) error {
131- return validateLicense (jwtWrapper )
131+ return ValidateLicense (jwtWrapper )
132132 },
133133 RunE : func (cmd * cobra.Command , args []string ) error {
134134 global , _ := cmd .Flags ().GetBool ("global" )
@@ -150,7 +150,7 @@ func secretsScanCommand(jwtWrapper wrappers.JWTWrapper) *cobra.Command {
150150 ` ,
151151 ),
152152 PreRunE : func (cmd * cobra.Command , args []string ) error {
153- return validateLicense (jwtWrapper )
153+ return ValidateLicense (jwtWrapper )
154154 },
155155 RunE : func (cmd * cobra.Command , args []string ) error {
156156 return precommit .Scan ()
@@ -173,7 +173,7 @@ func secretsIgnoreCommand(jwtWrapper wrappers.JWTWrapper) *cobra.Command {
173173 ` ,
174174 ),
175175 PreRunE : func (cmd * cobra.Command , args []string ) error {
176- if err := validateLicense (jwtWrapper ); err != nil {
176+ if err := ValidateLicense (jwtWrapper ); err != nil {
177177 return err
178178 }
179179
0 commit comments