easypost.go 827 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package rules
  2. import (
  3. "regexp"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func EasyPost() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. Description: "EasyPost API token",
  10. RuleID: "easypost-api-token",
  11. Regex: regexp.MustCompile(`EZAK(?i)[a-z0-9]{54}`),
  12. Keywords: []string{"EZAK"},
  13. }
  14. // validate
  15. tps := []string{
  16. generateSampleSecret("EZAK", "EZAK"+sampleAlphaNumeric54Token),
  17. }
  18. return validate(r, tps)
  19. }
  20. func EasyPostTestAPI() *config.Rule {
  21. // define rule
  22. r := config.Rule{
  23. Description: "EasyPost test API token",
  24. RuleID: "easypost-test-api-token",
  25. Regex: regexp.MustCompile(`EZTK(?i)[a-z0-9]{54}`),
  26. Keywords: []string{"EZTK"},
  27. }
  28. // validate
  29. tps := []string{
  30. generateSampleSecret("EZTK", "EZTK"+sampleAlphaNumeric54Token),
  31. }
  32. return validate(r, tps)
  33. }