Skip to main content

Module processor

Module processor 

Source
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.gz archives.
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.