Removed the unused --rlimit-nofile flag

This commit is contained in:
Mick Grove 2025-09-18 17:02:56 -07:00
commit 19cca00c2b
11 changed files with 21 additions and 32 deletions

View file

@ -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

View file

@ -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

View file

@ -88,15 +88,6 @@ pub static RAM_GB: Lazy<Option<f64>> = 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<String>,
#[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,
}

View file

@ -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<String>, skip_skipword: Vec<String>) -> Result<u
no_update_check: true,
self_update: false,
ignore_certs: false,
advanced: AdvancedArgs { rlimit_nofile: 8192 },
user_agent_suffix: None,
};
let loaded = RuleLoader::from_rule_specifiers(&scan_args.rules).load(&scan_args)?;

View file

@ -18,7 +18,7 @@ use kingfisher::{
rules::RuleSpecifierArgs,
scan::{ConfidenceLevel, ScanArgs},
},
global::{AdvancedArgs, Mode},
global::Mode,
GlobalArgs,
},
findings_store::FindingsStore,
@ -136,7 +136,7 @@ rules:
no_update_check: false,
self_update: false,
ignore_certs: false,
advanced: AdvancedArgs { rlimit_nofile: 8192 },
user_agent_suffix: None,
};
// ── load rules once ─────────────────────────────────────────────

View file

@ -15,7 +15,7 @@ use kingfisher::{
rules::RuleSpecifierArgs,
scan::{ConfidenceLevel, ScanArgs},
},
global::{AdvancedArgs, Mode},
global::Mode,
GlobalArgs,
},
findings_store::FindingsStore,
@ -123,7 +123,7 @@ fn test_github_remote_scan() -> 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)));

View file

@ -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)));

View file

@ -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)?;

View file

@ -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)));

View file

@ -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?;

View file

@ -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)));