shippo.go 636 B

1234567891011121314151617181920212223242526
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func ShippoAPIToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "shippo-api-token",
  10. Description: "Shippo API token",
  11. Regex: generateUniqueTokenRegex(`shippo_(live|test)_[a-f0-9]{40}`),
  12. SecretGroup: 1,
  13. Keywords: []string{
  14. "shippo_",
  15. },
  16. }
  17. // validate
  18. tps := []string{
  19. generateSampleSecret("shippo", "shippo_live_"+secrets.NewSecret(hex("40"))),
  20. generateSampleSecret("shippo", "shippo_test_"+secrets.NewSecret(hex("40"))),
  21. }
  22. return validate(r, tps, nil)
  23. }