Generate tps (#845)

* WIP

* simplify tp generation
This commit is contained in:
Zachary Rice authored and GitHub committed 2022-04-18 21:59:38 -05:00
1 parent d8cd93cabe
commit 3474c58c9e
58 files changed
+264 -337

No files matched your search

+14 -4
View File
@@ -3,6 +3,7 @@ package rules
import (
"regexp"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
@@ -16,7 +17,9 @@ func GitHubPat() *config.Rule {
}
// validate
tps := []string{"gihubPAT := \"ghp_" + sampleAlphaNumeric36Token + "\""}
tps := []string{
generateSampleSecret("github", "ghp_"+secrets.NewSecret(alphaNumeric("36"))),
}
return validate(r, tps)
}
@@ -30,7 +33,9 @@ func GitHubOauth() *config.Rule {
}
// validate
tps := []string{"gihubAuth := \"gho_" + sampleAlphaNumeric36Token + "\""}
tps := []string{
generateSampleSecret("github", "gho_"+secrets.NewSecret(alphaNumeric("36"))),
}
return validate(r, tps)
}
@@ -44,7 +49,10 @@ func GitHubApp() *config.Rule {
}
// validate
tps := []string{"gihubAuth := \"ghs_" + sampleAlphaNumeric36Token + "\""}
tps := []string{
generateSampleSecret("github", "ghu_"+secrets.NewSecret(alphaNumeric("36"))),
generateSampleSecret("github", "ghs_"+secrets.NewSecret(alphaNumeric("36"))),
}
return validate(r, tps)
}
@@ -58,6 +66,8 @@ func GitHubRefresh() *config.Rule {
}
// validate
tps := []string{"gihubAuth := \"ghr_" + sampleAlphaNumeric36Token + "\""}
tps := []string{
generateSampleSecret("github", "ghr_"+secrets.NewSecret(alphaNumeric("36"))),
}
return validate(r, tps)
}