mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
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:
1 parent
e9135cf0b5
commit
30c6117aaa
7 files changed
+97
-14
No files matched your search
+1
-1
@@ -72,7 +72,7 @@ func runDetect(cmd *cobra.Command, args []string) {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
// set redact flag
|
||||
if detector.Redact, err = cmd.Flags().GetBool("redact"); err != nil {
|
||||
if detector.Redact, err = cmd.Flags().GetUint("redact"); err != nil {
|
||||
log.Fatal().Err(err).Msg("")
|
||||
}
|
||||
if detector.MaxTargetMegaBytes, err = cmd.Flags().GetInt("max-target-megabytes"); err != nil {
|
||||
|
||||
Reference in new issue
Block a user