Skip to content

Commit

Permalink
avoid token alert
Browse files Browse the repository at this point in the history
  • Loading branch information
Baruch Odem committed Mar 12, 2024
1 parent dedb417 commit 8c1818b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/checkmarx/2ms/plugins"
)

var github_token = "ghp_vF93MdvGWEQkB7t" + "5csik0Vdsy2q99P3Nje1s"

func Test_Init(t *testing.T) {
allRules := *rules.FilterRules([]string{}, []string{}, []string{})
specialRule := rules.HardcodedPassword()
Expand Down Expand Up @@ -63,9 +65,8 @@ func Test_Init(t *testing.T) {

func TestDetector(t *testing.T) {
t.Run("ignore go.sum file", func(t *testing.T) {
token := "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"
i := item{
content: &token,
content: &github_token,
source: "path/to/go.sum",
}

Expand Down Expand Up @@ -114,7 +115,7 @@ func TestSecrets(t *testing.T) {
ShouldFind: true,
},
{
Content: "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",
Content: github_token,
Name: "GitHub Personal Access Token",
ShouldFind: true,
},
Expand Down

0 comments on commit 8c1818b

Please sign in to comment.