Make config generation utils public (#1480)

* chore(generate): make utils public

* chore(generate): change validate log messages

* chore(generate): split functions into files

* chore(config): add warning for public funcs
This commit is contained in:
Richard Gomez authored and GitHub committed 2024-08-26 13:11:18 -05:00
1 parent 3be7faa1ff
commit bd81872eee
114 files changed
+862 -713

No files matched your search

+9 -8
View File
@@ -1,6 +1,7 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"regexp"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
@@ -17,8 +18,8 @@ func ShopifySharedSecret() *config.Rule {
}
// validate
tps := []string{"shopifySecret := \"shpss_" + secrets.NewSecret(hex("32")) + "\""}
return validate(r, tps, nil)
tps := []string{"shopifySecret := \"shpss_" + secrets.NewSecret(utils.Hex("32")) + "\""}
return utils.Validate(r, tps, nil)
}
func ShopifyAccessToken() *config.Rule {
@@ -31,8 +32,8 @@ func ShopifyAccessToken() *config.Rule {
}
// validate
tps := []string{"shopifyToken := \"shpat_" + secrets.NewSecret(hex("32")) + "\""}
return validate(r, tps, nil)
tps := []string{"shopifyToken := \"shpat_" + secrets.NewSecret(utils.Hex("32")) + "\""}
return utils.Validate(r, tps, nil)
}
func ShopifyCustomAccessToken() *config.Rule {
@@ -45,8 +46,8 @@ func ShopifyCustomAccessToken() *config.Rule {
}
// validate
tps := []string{"shopifyToken := \"shpca_" + secrets.NewSecret(hex("32")) + "\""}
return validate(r, tps, nil)
tps := []string{"shopifyToken := \"shpca_" + secrets.NewSecret(utils.Hex("32")) + "\""}
return utils.Validate(r, tps, nil)
}
func ShopifyPrivateAppAccessToken() *config.Rule {
@@ -59,6 +60,6 @@ func ShopifyPrivateAppAccessToken() *config.Rule {
}
// validate
tps := []string{"shopifyToken := \"shppa_" + secrets.NewSecret(hex("32")) + "\""}
return validate(r, tps, nil)
tps := []string{"shopifyToken := \"shppa_" + secrets.NewSecret(utils.Hex("32")) + "\""}
return utils.Validate(r, tps, nil)
}