Open Laykou opened 1 year ago
I'm interested too
Here is rough workaround
const { abn } = require('/usr/local/lib/node_modules/@phuocng/fake-numbers');
const faker = require('/usr/local/lib/node_modules/pg-anonymizer/node_modules/faker');
const omitJsonField = (field, val, newFieldValue = 'Omitted') => {
const parsed = JSON.parse(val);
if (!parsed) {
return val;
}
// TODO: You can recursively search for the field as well
const newVal = {
...parsed,
[field]: newFieldValue
}
return JSON.stringify(newVal);
}
module.exports = {
omitReference: (val) => {
return omitJsonField("Reference", val);
}
};
Is it possible to anonymize values in JSONs (simple) structure?
Let's say I have JSONB column:
and I want to anonymize
data->>'first_name'
. Would that work too?