Skip to content

Commit

Permalink
fix: feedback and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanolin committed Aug 10, 2021
1 parent 7c5e455 commit a677136
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/earlybird.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"display_threshold_level": 3,
"display_confidence_threshold_level": 2,
"earlybird_config_url": "https://raw.githubusercontent.com/americanexpress/earlybird/main/config/earlybird.json",
"version": "2.0.1",
"version": "2.0.0",
"name": "earlybird"
}
20 changes: 20 additions & 0 deletions pkg/scan/scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,26 @@ func Test_scanLine(t *testing.T) {
},
wantIsHit: false,
},
{
name: "Find twitter API key as a password",
args: args{
line: Line{
LineValue: `twitterApiSecret:"111aAa222bBb333cCc444dDd555eEe666fFf777"`,
},
fileLines: fileLines,
},
wantIsHit: true,
},
{
name: "Ignore potential twitter API key separated by too many characters",
args: args{
line: Line{
LineValue: `twitter="twitter";//This LineValue emulates extremely long one-liner code files that can cause false positives "111aAa222bBb333cCc444dDd555eEe666fFf777"`,
},
fileLines: fileLines,
},
wantIsHit: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit a677136

Please sign in to comment.