Skip to main content

load_detector_cache

Function load_detector_cache 

Source
pub fn load_detector_cache(
    cache_path: &Path,
    source_dir: &Path,
) -> Option<Vec<DetectorSpec>>
Expand description

Load detectors from a JSON cache file. Returns None if cache is stale or missing.

§Examples

use keyhog_core::load_detector_cache;
use std::path::Path;

let _cached = load_detector_cache(
    Path::new(".keyhog-cache.json"),
    Path::new("detectors"),
);

§Security

Cached detectors are re-validated through the quality gate to prevent cache poisoning attacks where a malicious .keyhog-cache.json injects evil regex patterns that bypass the TOML quality gate.