mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
1 parent
01b553a75d
commit
ef4655fcf1
7 files changed
+240
-50
No files matched your search
+5
-5
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
// AllowList is struct containing items that if encountered will allowlist
|
||||
// a commit/line of code that would be considered a leak.
|
||||
type Allowlist struct {
|
||||
type AllowList struct {
|
||||
Description string
|
||||
Regexes []*regexp.Regexp
|
||||
Commits []string
|
||||
@@ -41,7 +41,7 @@ type Rule struct {
|
||||
File *regexp.Regexp
|
||||
Path *regexp.Regexp
|
||||
Tags []string
|
||||
Allowlist Allowlist
|
||||
AllowList AllowList
|
||||
Entropies []Entropy
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ type Rule struct {
|
||||
// Each Rule contains a description, regular expression, tags, and allowlists if available
|
||||
type Config struct {
|
||||
Rules []Rule
|
||||
Allowlist Allowlist
|
||||
Allowlist AllowList
|
||||
}
|
||||
|
||||
// TomlAllowList is a struct used in the TomlLoader that loads in allowlists from
|
||||
@@ -135,7 +135,7 @@ func (tomlLoader TomlLoader) Parse() (Config, error) {
|
||||
}
|
||||
|
||||
// rule specific allowlists
|
||||
var allowList Allowlist
|
||||
var allowList AllowList
|
||||
|
||||
// rule specific regexes
|
||||
for _, re := range rule.AllowList.Regexes {
|
||||
@@ -199,7 +199,7 @@ func (tomlLoader TomlLoader) Parse() (Config, error) {
|
||||
File: fileNameRe,
|
||||
Path: filePathRe,
|
||||
Tags: rule.Tags,
|
||||
Allowlist: allowList,
|
||||
AllowList: allowList,
|
||||
Entropies: entropies,
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestParse(t *testing.T) {
|
||||
wantErr error
|
||||
wantFileRegex *regexp.Regexp
|
||||
wantMessages *regexp.Regexp
|
||||
wantAllowlist Allowlist
|
||||
wantAllowlist AllowList
|
||||
}{
|
||||
{
|
||||
description: "default config",
|
||||
|
||||
Reference in new issue
Block a user