mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 04:34:46 +01:00
Add experimental allowlist optimizations (#1731)
* feat(allowlist): optimization experiments * refactor(allowlist): remove useOptimizations flag * refactor(allowlist): simplify Validate() with helper func * refactor(config): replace global feature flag
This commit is contained in:
1 parent
79068b35e5
commit
9faaa4a09c
9 files changed
+363
-42
No files matched your search
@@ -88,5 +88,10 @@ func createSingleRuleDetector(r *config.Rule) *detect.Detector {
|
||||
cfg := base.CreateGlobalConfig()
|
||||
cfg.Rules = rules
|
||||
cfg.Keywords = uniqueKeywords
|
||||
for _, a := range cfg.Allowlists {
|
||||
if err := a.Validate(); err != nil {
|
||||
logging.Fatal().Err(err).Msg("invalid global allowlist")
|
||||
}
|
||||
}
|
||||
return detect.NewDetector(cfg)
|
||||
}
|
||||
Reference in new issue
Block a user