Debian Codegraph @

pkg/detectors/twilio/twilio_auth_detector.go

raw symbols SCIP
1 package twilio
2
3 import (
4 "github.com/DefangLabs/secret-detector/pkg/detectors/helpers"
5 "github.com/DefangLabs/secret-detector/pkg/secrets"
6 )
7
8 const (
9 Name = "twilio"
10 secretType = "Twilio authentication"
11
12 // see https://www.twilio.com/docs/glossary/what-is-a-sid
13 accountSIDRegex = `AC[0-9a-fA-F]{32}`
14 authTokenRegex = `SK[0-9a-fA-F]{32}`
15 )
16
17 func init() {
18 secrets.GetDetectorFactory().Register(Name, NewDetector)
19 }
20
21 type detector struct {
22 secrets.Detector
23 }
24
25 func NewDetector(config ...string) secrets.Detector {
26 d := &detector{}
27 d.Detector = helpers.NewRegexDetectorBuilder(secretType, accountSIDRegex, authTokenRegex).Build()
28 return d
29 }