From 19cca00c2be5d67780b91805bc2dd4d7d6865084 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Thu, 18 Sep 2025 17:02:56 -0700 Subject: [PATCH] Removed the unused --rlimit-nofile flag --- CHANGELOG.md | 4 +++- Cargo.toml | 2 +- src/cli/global.rs | 13 ------------- tests/int_allowlist.rs | 4 ++-- tests/int_dedup.rs | 4 ++-- tests/int_github.rs | 4 ++-- tests/int_gitlab.rs | 6 +++--- tests/int_redact.rs | 4 ++-- tests/int_slack.rs | 4 ++-- tests/int_validation_cache.rs | 4 ++-- tests/int_vulnerable_files.rs | 4 ++-- 11 files changed, 21 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cd037b..2da5a2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. -## [Unreleased] +## [v1.52.0] - Enabled ANSI formatting in the tracing formatter whenever stderr is attached to a terminal so colorized updater messages render correctly instead of showing escape sequences. +- Added a new CLI flag, `--user-agent-suffix` to allow developers to append additional information to the user-agent +- Removed the unused --rlimit-nofile flag ## [1.51.0] - Added diff-only Git scanning via `--since-commit` and `--branch`, including remote-aware ref resolution so CI jobs can pair `--git-url` clones with pull request branches diff --git a/Cargo.toml b/Cargo.toml index 64665aa..f03a6e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ publish = false [package] name = "kingfisher" -version = "1.51.0" +version = "1.52.0" description = "MongoDB's blazingly fast secret scanning and validation tool" edition.workspace = true rust-version.workspace = true diff --git a/src/cli/global.rs b/src/cli/global.rs index f21535d..1b8883b 100644 --- a/src/cli/global.rs +++ b/src/cli/global.rs @@ -88,15 +88,6 @@ pub static RAM_GB: Lazy> = Lazy::new(|| { } }); -/// Advanced global options unlikely to be used in normal scenarios. -#[derive(Args, Debug, Clone)] -#[command(next_help_heading = "Advanced Global Options")] -pub struct AdvancedArgs { - /// Set the rlimit for the number of open files - #[arg(long, default_value_t = 16384, value_name = "LIMIT")] - pub rlimit_nofile: u64, -} - /// Top-level global CLI arguments #[derive(Args, Debug, Clone)] #[command(next_help_heading = "Global Options")] @@ -125,9 +116,6 @@ pub struct GlobalArgs { #[arg(global = true, long = "user-agent-suffix", value_name = "SUFFIX")] pub user_agent_suffix: Option, - #[command(flatten)] - pub advanced: AdvancedArgs, - // Internal fields (not CLI arguments) #[clap(skip)] pub color: Mode, @@ -145,7 +133,6 @@ impl Default for GlobalArgs { self_update: false, no_update_check: false, user_agent_suffix: None, - advanced: AdvancedArgs { rlimit_nofile: 16384 }, color: Mode::Auto, progress: Mode::Auto, } diff --git a/tests/int_allowlist.rs b/tests/int_allowlist.rs index cf4e456..358928e 100644 --- a/tests/int_allowlist.rs +++ b/tests/int_allowlist.rs @@ -14,7 +14,7 @@ use kingfisher::{ rules::RuleSpecifierArgs, scan::{ConfidenceLevel, ScanArgs}, }, - global::{AdvancedArgs, Mode}, + global::Mode, GlobalArgs, }, findings_store::FindingsStore, @@ -120,7 +120,7 @@ fn run_skiplist(skip_regex: Vec, skip_skipword: Vec) -> Result Result<()> { no_update_check: false, self_update: false, ignore_certs: false, - advanced: AdvancedArgs { rlimit_nofile: 16384 }, + user_agent_suffix: None, }; // Create in-memory datastore let datastore = Arc::new(Mutex::new(FindingsStore::new(clone_dir))); diff --git a/tests/int_gitlab.rs b/tests/int_gitlab.rs index cc6c5e7..bfbff4b 100644 --- a/tests/int_gitlab.rs +++ b/tests/int_gitlab.rs @@ -15,7 +15,7 @@ use kingfisher::{ rules::RuleSpecifierArgs, scan::{ConfidenceLevel, ScanArgs}, }, - global::{AdvancedArgs, Mode}, + global::Mode, GlobalArgs, }, findings_store::FindingsStore, @@ -121,7 +121,7 @@ fn test_gitlab_remote_scan() -> Result<()> { no_update_check: false, self_update: false, ignore_certs: false, - advanced: AdvancedArgs { rlimit_nofile: 16_384 }, + user_agent_suffix: None, }; let datastore = Arc::new(Mutex::new(FindingsStore::new(clone_dir))); @@ -233,7 +233,7 @@ fn test_gitlab_remote_scan_no_history() -> Result<()> { no_update_check: false, self_update: false, ignore_certs: false, - advanced: AdvancedArgs { rlimit_nofile: 16_384 }, + user_agent_suffix: None, }; let datastore = Arc::new(Mutex::new(FindingsStore::new(clone_dir))); diff --git a/tests/int_redact.rs b/tests/int_redact.rs index 2fa8bcb..fb4e6f1 100644 --- a/tests/int_redact.rs +++ b/tests/int_redact.rs @@ -15,7 +15,7 @@ use kingfisher::{ rules::RuleSpecifierArgs, scan::{ConfidenceLevel, ScanArgs}, }, - global::{AdvancedArgs, GlobalArgs, Mode}, + global::{GlobalArgs, Mode}, }, findings_store::FindingsStore, rule_loader::RuleLoader, @@ -103,7 +103,7 @@ async fn test_redact_hashes_finding_values() -> Result<()> { self_update: false, progress: Mode::Never, ignore_certs: false, - advanced: AdvancedArgs { rlimit_nofile: 16384 }, + user_agent_suffix: None, }; let loaded = RuleLoader::from_rule_specifiers(&scan_args.rules).load(&scan_args)?; diff --git a/tests/int_slack.rs b/tests/int_slack.rs index 0b96150..495f793 100644 --- a/tests/int_slack.rs +++ b/tests/int_slack.rs @@ -14,7 +14,7 @@ use kingfisher::{ rules::RuleSpecifierArgs, scan::{ConfidenceLevel, ScanArgs}, }, - global::{AdvancedArgs, Mode}, + global::Mode, GlobalArgs, }, findings_store::FindingsStore, @@ -211,7 +211,7 @@ async fn test_scan_slack_messages() -> Result<()> { self_update: false, progress: Mode::Never, ignore_certs: false, - advanced: AdvancedArgs { rlimit_nofile: 16384 }, + user_agent_suffix: None, }; let datastore = Arc::new(Mutex::new(FindingsStore::new(clone_dir))); diff --git a/tests/int_validation_cache.rs b/tests/int_validation_cache.rs index b468b0e..a3f6d31 100644 --- a/tests/int_validation_cache.rs +++ b/tests/int_validation_cache.rs @@ -18,7 +18,7 @@ use kingfisher::{ rules::RuleSpecifierArgs, scan::{ConfidenceLevel, ScanArgs}, }, - global::{AdvancedArgs, Mode}, + global::Mode, GlobalArgs, }, findings_store::FindingsStore, @@ -197,7 +197,7 @@ async fn test_validation_cache_and_depvars() -> Result<()> { no_update_check: false, self_update: false, ignore_certs: false, - advanced: AdvancedArgs { rlimit_nofile: 8192 }, + user_agent_suffix: None, }; run_async_scan(&global_args, &scan_args, Arc::clone(&datastore), &rules_db).await?; diff --git a/tests/int_vulnerable_files.rs b/tests/int_vulnerable_files.rs index db50f94..623aa69 100644 --- a/tests/int_vulnerable_files.rs +++ b/tests/int_vulnerable_files.rs @@ -16,7 +16,7 @@ use kingfisher::{ rules::RuleSpecifierArgs, scan::{ConfidenceLevel, ScanArgs}, }, - global::{AdvancedArgs, Mode}, + global::Mode, GlobalArgs, }, findings_store::FindingsStore, @@ -209,7 +209,7 @@ impl TestContext { self_update: false, progress: Mode::Never, ignore_certs: false, - advanced: AdvancedArgs { rlimit_nofile: 16384 }, + user_agent_suffix: None, }; let datastore = Arc::new(Mutex::new(FindingsStore::new(clone_dir)));