mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
fix(generate): move newline out of char range (#1719)
This commit is contained in:
1 parent
52b895a603
commit
69ed20e25e
2 files changed
+143
-142
No files matched your search
@@ -28,7 +28,7 @@ const (
|
||||
// boundaries for the secret
|
||||
secretPrefixUnique = `\b(`
|
||||
secretPrefix = `[\x60'"\s=]{0,5}(`
|
||||
secretSuffix = `)(?:[\x60'"\s;\\n]|$)`
|
||||
secretSuffix = `)(?:[\x60'"\s;]|\\[nr]|$)`
|
||||
)
|
||||
|
||||
func GenerateSemiGenericRegex(identifiers []string, secretRegex string, isCaseInsensitive bool) *regexp.Regexp {
|
||||
@@ -94,6 +94,7 @@ func GenerateSampleSecrets(identifier string, secret string) []string {
|
||||
"json - string": "{\n \"{i}_token\": \"{s}\"\n}",
|
||||
// TODO: "json - escaped string": "\\{\n \\\"{i}_token\\\": \\\"{s}\\\"\n\\}",
|
||||
// TODO: "json - string key/value": "{\n \"name\": \"{i}_token\",\n \"value\": \"{s}\"\n}",
|
||||
"json - escaped newline in string": `{"config.ini": "{I}_TOKEN={s}\nBACKUP_ENABLED=true"}`,
|
||||
// XML
|
||||
// TODO: "xml - element": "<{i}Token>{s}</{i}Token>",
|
||||
"xml - element multiline": "<{i}Token>\n {s}\n</{i}Token>",
|
||||
|
||||
+141
-141
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user