mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 20:54:22 +01:00
Global allowlist regex (#422)
* work in progress * Update test configs * adding test * golint and change to allowlist * fix race condition, this mistakenly got committed * Updating tests and examples * bump to v6 as this is a breaking change to the config * More consistent variables
This commit is contained in:
1 parent
6129b1a15d
commit
fae366a404
69 files changed
+449
-204
No files matched your search
+4
-3
@@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v5/manager"
|
||||
"github.com/zricethezav/gitleaks/v6/manager"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
@@ -96,7 +96,7 @@ func (repo *Repo) Scan() error {
|
||||
}
|
||||
|
||||
// Check if Commit is allowlisted
|
||||
if isCommitWhiteListed(c.Hash.String(), repo.config.Allowlist.Commits) {
|
||||
if isCommitAllowListed(c.Hash.String(), repo.config.Allowlist.Commits) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -140,9 +140,10 @@ func (repo *Repo) Scan() error {
|
||||
start := time.Now()
|
||||
patch, err := parent.Patch(c)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not generate Patch")
|
||||
log.Errorf("could not generate Patch")
|
||||
}
|
||||
repo.Manager.RecordTime(manager.PatchTime(howLong(start)))
|
||||
|
||||
wg.Add(1)
|
||||
semaphore <- true
|
||||
go func(c *object.Commit, patch *object.Patch) {
|
||||
|
||||
Reference in new issue
Block a user