Skip to content

Commit

Permalink
splitted to two versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kashifkhan0771 committed Jan 8, 2025
1 parent d21f03a commit b5ed85a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/detectors/sentrytoken/v1/sentrytoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Organization struct {

// Ensure the Scanner satisfies the interface at compile time.
var _ detectors.Detector = (*Scanner)(nil)
var _ detectors.Versioner = (*Scanner)(nil)

var (
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
Expand All @@ -34,6 +35,10 @@ var (
forbiddenError = "You do not have permission to perform this action."
)

func (s Scanner) Version() int {
return 1
}

// Keywords are used for efficiently pre-filtering chunks.
// Use identifiers in the secret preferably, or the provider name.
func (s Scanner) Keywords() []string {
Expand Down
5 changes: 5 additions & 0 deletions pkg/detectors/sentrytoken/v2/sentrytoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ type Scanner struct {

// Ensure the Scanner satisfies the interface at compile time.
var _ detectors.Detector = (*Scanner)(nil)
var _ detectors.Versioner = (*Scanner)(nil)

var (
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
keyPat = regexp.MustCompile(`\b(sntryu_[a-f0-9]{64})\b`)
)

func (s Scanner) Version() int {
return 2
}

// Keywords are used for efficiently pre-filtering chunks.
// Use identifiers in the secret preferably, or the provider name.
func (s Scanner) Keywords() []string {
Expand Down

0 comments on commit b5ed85a

Please sign in to comment.