File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 22
22
client = common .SaneHttpClient ()
23
23
24
24
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
25
- keyPat = regexp .MustCompile (detectors .PrefixRegex ([]string {"besttime" }) + `\b([0-9A-Za-z_]{36 })\b` )
25
+ keyPat = regexp .MustCompile (detectors .PrefixRegex ([]string {"besttime" }) + `\b(pri_[a-f0-9]{32 })\b` )
26
26
)
27
27
28
28
// Keywords are used for efficiently pre-filtering chunks.
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ import (
12
12
)
13
13
14
14
var (
15
- validPattern = "4K1WTb2ysVeg_jHDwtwhH68K9MuOjiTtXQCS "
15
+ validPattern = "pri_099889f14d114dfaae476569b395eade "
16
16
complexPattern = `
17
17
func main() {
18
- url := "https://api.example.com/v1/besttime/keys/4K1WTb2ysVeg_jHDwtwhH68K9MuOjiTtXQCS "
18
+ url := "https://api.example.com/v1/besttime/keys/pri_099889f14d114dfaae476569b395eade "
19
19
20
20
// Create a new request with the secret as a header
21
21
req, err := http.NewRequest("GET", url, http.NoBody)
@@ -52,12 +52,12 @@ func TestBestTime_Pattern(t *testing.T) {
52
52
{
53
53
name : "valid pattern" ,
54
54
input : fmt .Sprintf ("besttime credentials: %s" , validPattern ),
55
- want : []string {"4K1WTb2ysVeg_jHDwtwhH68K9MuOjiTtXQCS " },
55
+ want : []string {"pri_099889f14d114dfaae476569b395eade " },
56
56
},
57
57
{
58
58
name : "valid pattern - complex" ,
59
59
input : complexPattern ,
60
- want : []string {"4K1WTb2ysVeg_jHDwtwhH68K9MuOjiTtXQCS " },
60
+ want : []string {"pri_099889f14d114dfaae476569b395eade " },
61
61
},
62
62
{
63
63
name : "invalid pattern" ,
You can’t perform that action at this time.
0 commit comments