Documentation
¶
Overview ¶
Code generated by generate_rules.py. DO NOT EDIT.
Package secrets detects and redacts credential-like strings before output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CompiledRules = []Rule{}/* 221 elements not displayed */
Functions ¶
This section is empty.
Types ¶
type Rule ¶
Rule is a named regex used to find secrets. When Keywords is non-empty, the regex is only evaluated if at least one keyword appears in the content.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner scans content against the compiled gitleaks rules.
func (*Scanner) RedactContent ¶
RedactContent scans and sanitizes content for a single file. The keyword fast-path skips a rule's regex unless at least one of its keywords appears in the (case-folded) content. Content without detections (the common case) is returned untouched; the working copy is materialized only when the first rule matches.
func (*Scanner) RedactSelectedFiles ¶
RedactSelectedFiles runs secret scanning concurrently over the given files. Each worker sanitizes a disjoint slice of the returned copy, so no entry is ever mutated concurrently. SecretCount is set to the number of detections.