Skip to main content

Crate keyhog_sources

Crate keyhog_sources 

Source
Expand description

Pluggable input sources for KeyHog.

Each source implements the keyhog_core::Source trait and yields keyhog_core::Chunk values for the scanner. Sources are gated behind cargo features so only the transitive dependencies you actually need are compiled.

Modules§

http
Shared HTTP-client policy (proxy, TLS, UA) used by every source
reqwest
Local HTTP compatibility shim backed by reqwest. Only present when at least one feature that pulls in reqwest is enabled - otherwise this module would pub use reqwest::* against a crate that wasn’t compiled in, which fails resolution on stable rustc (especially on Windows where --no-default-features is the release profile we ship for the no-Hyperscan build).
strings
Printable string extraction from binary data. Shared by the filesystem source (auto-detection) and binary source (explicit).
timeouts
Shared timeouts for remote / subprocess sources (avoid magic-number drift).

Structs§

FilesystemSource
Scans files in a directory tree.
GitDiffSource
Scans only the ADDED lines between two git refs. Uses git diff unified diff output and extracts lines starting with ‘+’. Useful for CI/CD pre-commit hooks and PR checks.
GitHistorySource
Scans git history commit-by-commit using patch output and extracts added lines.
GitSource
Scans git history: traverses commits and extracts text blob contents.
StdinSource
Reads all of stdin as a single chunk.
WebSource
Web content source that fetches JavaScript, source maps, and WASM from URLs.

Statics§

SKIPPED_OVER_MAX_SIZE
How many files the filesystem walker skipped because they exceeded the active --max-file-size cap. Bumped once per skipped entry inside FilesystemSource::process_entry; the orchestrator reads it at end-of-scan to emit a single summary line so users see what the previously-silent walker filter dropped (kimi-1 dogfood #130). Counter is process-global; reset between scans by the test harness via reset_skipped_over_max_size().

Functions§

create_source
Create a source instance from a name and optional parameters. This allows the CLI to remain agnostic of specific source implementations.
register_plugins
Register all compiled-in source plugins into the global registry. This allows the CLI to discover sources like slack or s3 via the generic --source flag without hardcoded logic in the main crate.
reset_skipped_over_max_size
Reset the over-max-size counter. Public so test fixtures that run multiple scans in one process can baseline between runs.