nytimes.go 654 B

1234567891011121314151617181920212223242526272829
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func NytimesAccessToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "nytimes-access-token",
  10. Description: "Nytimes Access Token",
  11. Regex: generateSemiGenericRegex([]string{
  12. "nytimes", "new-york-times,", "newyorktimes"},
  13. alphaNumericExtended("32")),
  14. SecretGroup: 1,
  15. Keywords: []string{
  16. "nytimes",
  17. "new-york-times",
  18. "newyorktimes",
  19. },
  20. }
  21. // validate
  22. tps := []string{
  23. generateSampleSecret("nytimes", secrets.NewSecret(alphaNumeric("32"))),
  24. }
  25. return validate(r, tps, nil)
  26. }