forked from mirrors/kingfisher
commit
6264933285
5 changed files with 22 additions and 37 deletions
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [v1.63.1]
|
||||
- Updated allocator
|
||||
|
||||
## [v1.63.0]
|
||||
- Fixed bug when retrieving some finding values and injecting them as TOKENS in the rule templates
|
||||
- Improved Datadog rule
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ publish = false
|
|||
|
||||
[package]
|
||||
name = "kingfisher"
|
||||
version = "1.63.0"
|
||||
version = "1.63.1"
|
||||
description = "MongoDB's blazingly fast and accurate secret scanning and validation tool"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
|
|
|||
30
src/main.rs
30
src/main.rs
|
|
@ -5,27 +5,27 @@
|
|||
// * Fallback - system allocator (`system-alloc` feature)
|
||||
// ────────────────────────────────────────────────────────────
|
||||
|
||||
// // --- jemalloc (opt-in) ---
|
||||
// #[cfg(feature = "use-jemalloc")]
|
||||
// #[global_allocator]
|
||||
// static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
||||
// --- jemalloc (opt-in) ---
|
||||
#[cfg(feature = "use-jemalloc")]
|
||||
#[global_allocator]
|
||||
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
||||
|
||||
// // --- mimalloc (default) ---
|
||||
// #[cfg(all(not(feature = "use-jemalloc"), not(feature = "system-alloc")))]
|
||||
// #[global_allocator]
|
||||
// static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
// // --- system allocator (explicit opt-out) ---
|
||||
// #[cfg(feature = "system-alloc")]
|
||||
// use std::alloc::System;
|
||||
// #[cfg(feature = "system-alloc")]
|
||||
// #[global_allocator]
|
||||
// static GLOBAL: System = System;
|
||||
// --- mimalloc (default) ---
|
||||
#[cfg(all(not(feature = "use-jemalloc"), not(feature = "system-alloc")))]
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
// --- system allocator (explicit opt-out) ---
|
||||
#[cfg(feature = "system-alloc")]
|
||||
use std::alloc::System;
|
||||
#[cfg(feature = "system-alloc")]
|
||||
#[global_allocator]
|
||||
static GLOBAL: System = System;
|
||||
|
||||
// use std::alloc::System;
|
||||
// #[global_allocator]
|
||||
// static GLOBAL: System = System;
|
||||
|
||||
use std::{
|
||||
io::{IsTerminal, Read},
|
||||
sync::{Arc, Mutex},
|
||||
|
|
|
|||
|
|
@ -374,9 +374,9 @@ impl<'a> Matcher<'a> {
|
|||
} else {
|
||||
None
|
||||
};
|
||||
/////////////////////////////
|
||||
//
|
||||
// Process matches
|
||||
/////////////////////////////
|
||||
//
|
||||
let mut matches = Vec::new();
|
||||
let owned_ts_results = tree_sitter_result.map(|ts_results| {
|
||||
ts_results
|
||||
|
|
@ -567,7 +567,6 @@ fn record_match(
|
|||
) -> bool {
|
||||
insert_span(map.entry(rule_id).or_default(), span)
|
||||
}
|
||||
// in src/matcher.rs
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn filter_match<'b>(
|
||||
|
|
@ -1025,7 +1024,7 @@ pub struct DecodedData {
|
|||
}
|
||||
#[inline]
|
||||
fn is_base64_byte(b: u8) -> bool {
|
||||
// Include URL-safe characters '-' and '_'
|
||||
// Accepts both standard base64 ('+', '/') and URL-safe base64 ('-', '_') characters.
|
||||
matches!(b, b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'+' | b'/' | b'-' | b'_')
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,22 +27,6 @@ pub fn process_captures(captures: &SerializableCaptures) -> Vec<(String, String,
|
|||
.collect()
|
||||
}
|
||||
|
||||
// /// Return (NAME, value, start, end) for every capture we care about.
|
||||
// ///
|
||||
// /// * If a capture has a name, use that (upper-cased)
|
||||
// /// * If it’s unnamed, fall back to `"TOKEN"`
|
||||
// pub fn process_captures(captures: &SerializableCaptures) -> Vec<(String, String, usize, usize)> {
|
||||
// captures
|
||||
// .captures
|
||||
// .iter()
|
||||
// .map(|cap| {
|
||||
// let name =
|
||||
// cap.name.as_ref().map(|n| n.to_uppercase()).unwrap_or_else(|| "TOKEN".to_string());
|
||||
// (name, cap.value.to_string(), cap.start, cap.end)
|
||||
// })
|
||||
// .collect()
|
||||
// }
|
||||
|
||||
pub fn find_closest_variable(
|
||||
captures: &[(String, String, usize, usize)],
|
||||
target_value: &String,
|
||||
|
|
@ -195,7 +179,6 @@ mod tests {
|
|||
// --- END FIX ---
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[test]
|
||||
fn includes_whole_match_and_unnamed_groups() {
|
||||
let captures = SerializableCaptures {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue