---
# System prepended metadata

title: GDPR

---

GDPR
====

```json=

// input.<NAME> is external input provided by some other source

"postgres_stage": { // stage
  // data will be written to disk after every table to avoid filling ram
  "indigo": [ // scope
    {
      "name": "table_1"
      "filter_keys": [
        {
          "field_name": "field_1",
          "value": "{{ input.VALUE_1 }}"
        }, 
        {
          "field_name": "field_1",
          "value": "{{ input.VALUE_2 }}"
        }
      ],
      "masked_fields": [
        {
          "field_name": "field_3"
          "anonymizer": "UUID" // field data type
        },
        {
          "field_name": "field_3"
          "anonymizer": "INT32"
        }
      ], 
      // Output from every table step needs to be passed to the next
      // table step
      "children": [
        { // array of table 
          "name": "table_2"
          "filter_keys": [
            "field_name": "field_1",
            "value": "{{ table1.field_1 }}"
          ]
        }
      ]
    }
  ],
  "group": [
    // tables ...
  ]
}

"mongo_stage": {

}
```

indigo example

```YAML=
indigo:
  - table: user_roles
    filter_keys:
      - field_name: user_account_id
        value: '{{ input.USER_ACC_ID }}'
    children:
      - table: role_definitions
        filter_keys:
          - field_name: id
            value: '{{ user_roles.role_id }}'
      - table: role_permissons
        filter_keys:
          - field_name: role_id
            value: '{{ user_roles.role_id }}'
  - table: user_permissions
    filter_keys:
      - field_name: user_account_id
        value: '{{ input.USER_ACC_ID }}'
```


* supports multiple datasources
* process gdpr requests in batches to not lock tabels or other resources too long
* gdpr database:
    * time of gdpr request
    * email to send the export to
    * user account id