Struct minos_codex::scanner::Scanner
source · pub struct Scanner { /* private fields */ }Implementations§
source§impl Scanner
impl Scanner
pub fn new(config: Config) -> Self
sourcepub fn scan(&mut self, input: &str) -> Result<Vec<FoundSecret>, MinosCodexError>
pub fn scan(&mut self, input: &str) -> Result<Vec<FoundSecret>, MinosCodexError>
Examples found in repository?
examples/basic_usage.rs (line 15)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
fn run() -> Result<(), MinosCodexError> {
let mut scanner = create_scanner("detections")?;
let input = "My email is example@email.com and my AWS access key is AKIAIOSFODNN7EXAMPLE";
let found_secrets = scanner.scan(input)?;
if found_secrets.is_empty() {
println!("No secrets found.");
} else {
println!("Found secrets:");
for secret in found_secrets {
println!(" Type: {}", secret.secret_type);
println!(" Value: {}", secret.value);
println!(" Position: {}:{}", secret.start, secret.end);
println!();
}
}
Ok(())
}Auto Trait Implementations§
impl Freeze for Scanner
impl RefUnwindSafe for Scanner
impl Send for Scanner
impl Sync for Scanner
impl Unpin for Scanner
impl UnwindSafe for Scanner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more