Debian Codegraph @

pkg/detectors/artifactory/artifactory_detector.go

raw symbols SCIP
1 package artifactory
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 = "artifactory"
10 secretType = "JFrog Artifactory credentials"
11
12 // artifactoryTokenRegex represents a regex that matches an artifactory token.
13 // Artifactory token always begins with AKC.
14 artifactoryTokenRegex = `AKC[a-zA-Z0-9]{10,}`
15
16 // artifactoryEncryptedPasswordRegex represents a regex that matches an artifactory encrypted password.
17 // Artifactory encrypted passwords always begin with AP.
18 // this detection is removed
19 artifactoryEncryptedPasswordRegex = `AP[\dABCDEF][a-zA-Z0-9]{8,}`
20 )
21
22 func init() {
23 secrets.GetDetectorFactory().Register(Name, NewDetector)
24 }
25
26 type detector struct {
27 secrets.Detector
28 }
29
30 func NewDetector(config ...string) secrets.Detector {
31 d := &detector{}
32 d.Detector = helpers.NewRegexDetectorBuilder(secretType, artifactoryTokenRegex).Build()
33 return d
34 }