Expand description
Structured processors for format-aware sanitization.
§Architecture
┌──────────────────┐ ┌───────────────────┐ ┌──────────────────┐
│ Input bytes │ ──▶ │ ProcessorRegistry │ ──▶ │ Output bytes │
│ (file content) │ │ (profile matching) │ │ (sanitized) │
└──────────────────┘ └────────┬───────────┘ └──────────────────┘
│
┌────────▼────────┐
│ dyn Processor │
│ │
│ KeyValue │ ← gitlab.rb-style
│ JsonProcessor │ ← JSON files
│ YamlProcessor │ ← YAML files
│ XmlProcessor │ ← XML files
│ CsvProcessor │ ← CSV/TSV files
└────────┬────────┘
│
┌────────▼────────┐
│ MappingStore │
│ (one-way dedup) │
└─────────────────┘§File-Type Profiles
A FileTypeProfile specifies which processor to use and what
fields/keys to sanitize. Users provide profiles to control which
parts of a structured file are replaced. If no profile matches,
the caller falls back to the streaming scanner.
§Extensibility
Implement the Processor trait and register it with the
ProcessorRegistry. The registry matches profiles to processors
by name and dispatches processing.
Re-exports§
pub use profile::FieldRule;pub use profile::FileTypeProfile;pub use registry::ProcessorRegistry;
Modules§
- archive
- Archive processor for sanitizing files inside
.zip,.tar, and.tar.gzarchives. - csv_
proc - CSV structured processor.
- json_
proc - JSON structured processor.
- key_
value - Key-value processor for
gitlab.rb-style configuration files. - profile
- File-type profiles for structured processors.
- registry
- Processor registry — discovers and dispatches structured processors.
- xml_
proc - XML structured processor.
- yaml_
proc - YAML structured processor.
Traits§
- Processor
- A structured processor that can sanitize a specific file format while preserving its structure and formatting as much as possible.