Skip to content

Find, verify, and analyze leaked credentials

Add DetectorName to Result (#1223)

Bill Rich762641d9709d
diff --git a/pkg/custom_detectors/custom_detectors.go b/pkg/custom_detectors/custom_detectors.go
index 265b2d4fc..09b7e928c 100644
--- a/pkg/custom_detectors/custom_detectors.go
+++ b/pkg/custom_detectors/custom_detectors.go
@@ -117,6 +117,7 @@ func (c *customRegexWebhook) createResults(ctx context.Context, match map[string
}
result := detectors.Result{
DetectorType: detectorspb.DetectorType_CustomRegex,
+ DetectorName: c.GetName(),
Raw: []byte(raw),
}
diff --git a/pkg/detectors/detectors.go b/pkg/detectors/detectors.go
index 3e376d19e..7d395bdb0 100644
--- a/pkg/detectors/detectors.go
+++ b/pkg/detectors/detectors.go
@@ -34,6 +34,8 @@ type Versioner interface {
type Result struct {
// DetectorType is the type of Detector.
DetectorType detectorspb.DetectorType
+ // DetectorName is the name of the Detector. Used for custom detectors.
+ DetectorName string
// DecoderType is the type of Decoder.
DecoderType detectorspb.DecoderType
Verified bool