Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InspectFile ¶
InspectFile accepts a file content, fullpath of file, commit and repo. If the file is binary OR if a file is matched on whitelisted files set in the configuration, then gitleaks will skip auditing that file. It will check first if rules apply to this file comparing filename and path to their respective rule regexes and inspect file content with inspectFileContents after.
func RegexMatched ¶ added in v4.2.0
RegexMatched matched an interface to a regular expression. The interface f can be a string type or go-git *object.File type.
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.