mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Whitelist repo (#378)
* fixing commit latest bug * bumping go-git and adding repo whitelist * adding tests
This commit is contained in:
1 parent
8bd4649b01
commit
473d0d55a7
12 files changed
+282
-65
No files matched your search
+6
-3
@@ -11,9 +11,9 @@ import (
|
||||
|
||||
"github.com/jessevdk/go-flags"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/src-d/go-git.v4"
|
||||
"gopkg.in/src-d/go-git.v4/plumbing/transport/http"
|
||||
"gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/plumbing/transport/http"
|
||||
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
|
||||
)
|
||||
|
||||
// No leaks or early exit due to invalid options
|
||||
@@ -110,6 +110,9 @@ func (opts Options) Guard() error {
|
||||
if !oneOrNoneSet(opts.AccessToken, opts.Password) {
|
||||
log.Warn("both access-token and password are set. Only password will be attempted")
|
||||
}
|
||||
if !oneOrNoneSet(opts.FilesAtCommit, opts.Commit, opts.CommitTo, opts.CommitFrom) {
|
||||
return fmt.Errorf("invalid commit options set")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user