Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

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.

Two pipes with named ports. The input email goes into lowercase (port text to port text), then into mask-email (port email to port email). Alice@Example.COM becomes alice@example.com, then a***e@example.com."Alice@Example.COM""alice@example.com""a***e@example.com"input: emaillowercasetexttextmask-emailemailemailoutput: email
Two pipes with named ports. The input email goes into lowercase (port text to port text), then into mask-email (port email to port email). Alice@Example.COM becomes alice@example.com, then a***e@example.com."Alice@Example.COM""alice@example.com""a***e@example.com"input: emaillowercasetexttextmask-emailemailemailoutput: email
Two small pipes. Each one names its ports, so connecting them is a line of YAML rather than glue code.

What goes in, what comes out

Input (stdin)
"Alice@Example.COM"
Command
printf '"Alice@Example.COM"\n' | openflange run ./examples/email/normalize-and-mask-email
Output (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.email
Look inside without running
openflange validate ./examples/email/normalize-and-mask-email --plan
openflange inspect ./examples/email/pipes/mask-email
openflange test ./examples/email

What 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-email keeps 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 optional rejected output; if nothing reads rejected, the run fails rather than dropping the record.
  • Masking is not anonymisation: the domain and the edge characters can still identify a person.