File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ func (Scanner) CloudEndpoint() string { return "https://gitlab.com" }
33
33
34
34
var (
35
35
defaultClient = common .SaneHttpClient ()
36
- keyPat = regexp .MustCompile (detectors .PrefixRegex ([]string {"gitlab" }) + `\b([a-zA-Z0-9\-=_]{20,22 })\b` )
36
+ keyPat = regexp .MustCompile (detectors .PrefixRegex ([]string {"gitlab" }) + `\b([a-zA-Z0-9][a-zA-Z0-9 \-=_]{19,21 })\b` )
37
37
38
38
BlockedUserMessage = "403 Forbidden - Your account has been blocked"
39
39
)
Original file line number Diff line number Diff line change 25
25
"method": "GET",
26
26
"deprecated": false
27
27
}]`
28
- secret = "oXCt4JT2wf1_WlZl2OVG"
28
+ secret = "oXCt4JT2wf1_WlZl2OVG"
29
+ validPattern2 = "GITLAB_TOKEN=ABc123456789dEFghIJK"
30
+ secret2 = "ABc123456789dEFghIJK"
29
31
)
30
32
31
33
func TestGitLab_Pattern (t * testing.T ) {
@@ -42,6 +44,11 @@ func TestGitLab_Pattern(t *testing.T) {
42
44
input : validPattern ,
43
45
want : []string {secret },
44
46
},
47
+ {
48
+ name : "valid pattern (with = before secret)" ,
49
+ input : validPattern2 ,
50
+ want : []string {secret2 },
51
+ },
45
52
}
46
53
47
54
for _ , test := range tests {
You can’t perform that action at this time.
0 commit comments