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

+6 -5
View File
@@ -1,6 +1,7 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
@@ -10,8 +11,8 @@ func KrakenAccessToken() *config.Rule {
r := config.Rule{
RuleID: "kraken-access-token",
Description: "Identified a Kraken Access Token, potentially compromising cryptocurrency trading accounts and financial security.",
Regex: generateSemiGenericRegex([]string{"kraken"},
alphaNumericExtendedLong("80,90"), true),
Regex: utils.GenerateSemiGenericRegex([]string{"kraken"},
utils.AlphaNumericExtendedLong("80,90"), true),
Keywords: []string{
"kraken",
@@ -20,8 +21,8 @@ func KrakenAccessToken() *config.Rule {
// validate
tps := []string{
generateSampleSecret("kraken",
secrets.NewSecret(alphaNumericExtendedLong("80,90"))),
utils.GenerateSampleSecret("kraken",
secrets.NewSecret(utils.AlphaNumericExtendedLong("80,90"))),
}
return validate(r, tps, nil)
return utils.Validate(r, tps, nil)
}