Skip to content

Commit def734a

Browse files
fixed github issue 3774 for custom detector secret size (#3816)
1 parent ddc015e commit def734a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/custom_detectors/custom_detectors.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type CustomRegexWebhook struct {
3232
// Ensure the Scanner satisfies the interface at compile time.
3333
var _ detectors.Detector = (*CustomRegexWebhook)(nil)
3434
var _ detectors.CustomFalsePositiveChecker = (*CustomRegexWebhook)(nil)
35+
var _ detectors.MaxSecretSizeProvider = (*CustomRegexWebhook)(nil)
3536

3637
// NewWebhookCustomRegex initializes and validates a CustomRegexWebhook. An
3738
// unexported type is intentionally returned here to ensure the values have
@@ -115,6 +116,11 @@ func (c *CustomRegexWebhook) IsFalsePositive(_ detectors.Result) (bool, string)
115116
return false, ""
116117
}
117118

119+
// custom max size for custom detector
120+
func (c *CustomRegexWebhook) MaxSecretSize() int64 {
121+
return 1000
122+
}
123+
118124
func (c *CustomRegexWebhook) createResults(ctx context.Context, match map[string][]string, verify bool, results chan<- detectors.Result) error {
119125
if common.IsDone(ctx) {
120126
// TODO: Log we're possibly leaving out results.

0 commit comments

Comments
 (0)