nytimes.go 643 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"), true),
  14. Keywords: []string{
  15. "nytimes",
  16. "new-york-times",
  17. "newyorktimes",
  18. },
  19. }
  20. // validate
  21. tps := []string{
  22. generateSampleSecret("nytimes", secrets.NewSecret(alphaNumeric("32"))),
  23. }
  24. return validate(r, tps, nil)
  25. }