Skip to content

Commit

Permalink
fix(anonymizer): transform emails via ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-van-woerkens committed Jun 25, 2024
1 parent 5af9713 commit 20cd279
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .anonymizer/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,14 @@ dump:
columns:
- name: "fonction"
skip_on_null_input: true
- name: "Template"
- name: "Cmd"
params:
column: "email"
template: |
{{ printf "%s-%d-%[email protected]" (.GetColumnValue "role") (.GetColumnValue "structureId") (.GetColumnValue "id") }}
<<: *cmd_default_params
args:
- "./dist/user-structure--email.js"
columns:
- name: "email"
skip_on_null_input: true
- name: "Cmd"
params:
<<: *cmd_default_params
Expand Down
7 changes: 7 additions & 0 deletions .anonymizer/ts-transformers/user-structure--email.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { main } from "./common/lib"

function anonymize(values: Record<string, any>) {
values.email = `${values.role}-${values.structureId}-${values.id}@domifa-fake.fabrique.social.gouv.fr`
}

main(["email"], anonymize)

0 comments on commit 20cd279

Please sign in to comment.