mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 20:54:22 +01:00
Add comma as operator for GenerateSemiGenericRegex (#1679)
* feat: add comma as operator for GenerateSemiGenericRegex * test: fix tests.
This commit is contained in:
1 parent
ab38a46986
commit
f0d4499064
4 files changed
+100
-99
No files matched your search
@@ -23,7 +23,7 @@ const (
|
||||
|
||||
// commonly used assignment operators or function call
|
||||
//language=regexp
|
||||
operator = `(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)`
|
||||
operator = `(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=|,)`
|
||||
|
||||
// boundaries for the secret
|
||||
// \x60 = `
|
||||
|
||||
@@ -93,11 +93,11 @@ func TestGenerateSemiGenericRegex(t *testing.T) {
|
||||
"api_key <= xxx",
|
||||
"api_key => xxx",
|
||||
"api_key ?= xxx",
|
||||
"api_key, xxx",
|
||||
},
|
||||
invalidStrings: []string{
|
||||
"api_keyxxx",
|
||||
"api_key\txxx", // potentially valid in a tab-separated file
|
||||
"api_key, xxx",
|
||||
"api_key; xxx",
|
||||
"api_key<xxx>",
|
||||
"api_key&xxx",
|
||||
|
||||
Reference in new issue
Block a user