--- spec: openflange.org/pipe/v0.1 id: normalize-and-mask-email version: 0.1.0 title: Normalize and mask email description: Lower-cases e-mail addresses, then masks the middle of the local part. license: Apache-2.0 keywords: [email, mask, privacy, composite] maturity: experimental scope: record inputs: email: description: E-mail addresses, one JSON string per NDJSON line. schema: format: json-schema definition: {type: string} outputs: email: description: Lower-cased, masked addresses. schema: format: json-schema definition: {type: string} parameters: character: {type: string, default: "*", description: Masking character (one Unicode code point).} preserveFirst: {type: integer, default: 1, minimum: 0, maximum: 8, description: Leading characters of the local part to keep.} preserveLast: {type: integer, default: 1, minimum: 0, maximum: 8, description: Trailing characters of the local part to keep.} implementation: type: pipeline path: pipeline.yaml --- # Normalize and mask email Implements the [OpenFlange](https://openflange.org/) specification. A composite pipe: `lowercase` → `mask-email`. Consumers see one pipe with one input and one output; the graph in `pipeline.yaml` is its implementation. ```sh printf '"Alice@Example.COM"\n' | openflange run ./normalize-and-mask-email # "a***e@example.com" ``` `mask-email`'s optional `rejected` output is not connected here, so an invalid address fails the run (`E_RUNTIME`) instead of being dropped. Use `normalize-and-mask-email-branching` to receive rejected inputs as data. Masking is not anonymisation: the domain and edge characters are preserved.