0.8.2 • Published 3 years ago

mqlredact v0.8.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

mqlredact

Redacts MongoDB Aggregation Pipelines by hashing user-provided keys and values.

Programmatic Usage (ESM)

import { redact } from "mqlredact";

console.log(
  redact(
    [
      { $match: { secretField: "secretValue" } },
      { $sort: { secretField: 1 } },
      { $limit: 1 },
    ],
    "a-hint-of-salt" // optional
  )
);

Programmatic Usage (CJS)

const redact = require("mqlredact").default;

console.log(
  redact(
    [
      { $match: { secretField: "secretValue" } },
      { $sort: { secretField: 1 } },
      { $limit: 1 },
    ],
    "a-hint-of-salt" // optional
  )
);

Command Line Usage

Install with:

npm install -g mqlredact

Run the script with an aggregation pipeline in JSON (and optional salt):

$ mqlredact '[{"$match":{"secretField":"secretValue"}},{"$sort":{"secretField":1}},{"$limit":1}]' --salt a-hint-of-salt

Output

[
  { "$match": { "2xhCG679ve": "3ifAaveZtF" } },
  { "$sort": { "2xhCG679ve": 1 } },
  { "$limit": 1 }
]
0.8.1

3 years ago

0.8.2

3 years ago

0.8.0

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.5

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago