How do I connect two steps?
Available — v0.0.1 (experimental)starlark
Mask an email
Two small pipes — lowercase, then mask — joined by one short pipeline file.
Available in v0.0.1: the files, README and tests are in examples/email of the openflange-go repository. Commands run from the repository root.
Needs: only the openflange CLI.
A pipe is a data-processing step with declared inputs and outputs.
What goes in, what comes out
Input (stdin)
"Alice@Example.COM"Command
printf '"Alice@Example.COM"\n' | openflange run ./examples/email/normalize-and-mask-emailOutput (stdout)
"a***e@example.com"Files and further commands
examples/email/normalize-and-mask-email/pipeline.yaml
# Implementation graph of normalize-and-mask-email (referenced by OPENFLANGE.md).
spec: openflange.org/pipeline/v0.1
nodes:
lowercase:
pipe: ../pipes/lowercase
inputs:
text:
from: inputs.email
mask:
pipe: ../pipes/mask-email
inputs:
email:
from: lowercase.outputs.text
parameters:
character: {$param: character}
preserveFirst: {$param: preserveFirst}
preserveLast: {$param: preserveLast}
outputs:
email:
from: mask.outputs.emailLook inside without running
openflange validate ./examples/email/normalize-and-mask-email --plan
openflange inspect ./examples/email/pipes/mask-email
openflange test ./examples/emailWhat to notice
- Each line on a stream is one JSON value, so a string is written with its quotes:
"Alice@Example.COM". - The pipeline file is the implementation of a composite pipe,
normalize-and-mask-email: its own parameters (character,preserveFirst,preserveLast) are forwarded to the mask node with{$param: …}. mask-emailkeeps the first and last character of the part before the@and never touches the domain. If that part is too short to hide anything (ab@x.io), every character of it is replaced:**@x.io.- An address without exactly one
@is not masked. It goes to the optionalrejectedoutput; if nothing readsrejected, the run fails rather than dropping the record. - Masking is not anonymisation: the domain and the edge characters can still identify a person.