Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InspectString ¶
InspectString accepts a string, commit object, repo, and filename. This function iterates over all the rules set by the gitleaks config. If the rule contains entropy checks then entropy will be checked first. Next, if the rule contains a regular expression then that will be checked.
Types ¶
type Repo ¶
type Repo struct { *git.Repository Name string Manager *manager.Manager // contains filtered or unexported fields }
Repo wraps a *git.Repository object in addition to a manager object and the name of the repo. Commits are inspected from the *git.Repository object. If a commit is found then we send it via the manager LeakChan where the manager receives and keeps track of all leaks.
func (*Repo) Audit ¶
Audit is responsible for scanning the entire history (default behavior) of a git repo. Options that can change the behavior of this function include: --commit, --depth, --branch. See options/options.go for an explanation on these options.
func (*Repo) AuditUncommitted ¶
AuditUncommitted will do a `git diff` and scan changed files that are being tracked. This is useful functionality for a pre-commit hook so you can make sure your code does not have any leaks before committing.