feat: Add optional redaction value, default 100 (#1229)

This commit introduces an optional value for the --redact flag, allowing
users to specify the extent of redaction for secrets. The valid range of
values is from 0 (no redaction) to 100 (full redaction).

If no value is provided, the default redaction value is set to 100,
resulting in complete redaction by replacing the secret with the term
'REDACTED'. This preserves the original behavior of the --redact flag.

Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
This commit is contained in:
FrankandZachary Rice authored and GitHub committed 2023-08-29 11:03:23 -05:00
1 parent e9135cf0b5
commit 30c6117aaa
7 files changed
+97 -14

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ type Detector struct {
// Redact is a flag to redact findings. This is exported
// so users using gitleaks as a library can set this flag
// without calling `detector.Start(cmd *cobra.Command)`
Redact bool
Redact uint
// verbose is a flag to print findings
Verbose bool