Smile-SA / gdpr-dump

Utility that creates anonymized database dumps (MySQL only). Provides default config templates for Magento, Drupal and Shopware.
GNU General Public License v3.0
169 stars 46 forks source link

Add `where` parameter and deprecate `filters` parameter #116

Closed guvra closed 6 months ago

guvra commented 6 months ago

New filter syntax:

tables:
    customer:
        where: 'email like "%@test.org" or created_at > date_sub(now(), interval 55 day)'

A query validator is making sure that the query does not include any dangerous statement (execute, drop, alter...).

The PR deprecates the filters param. This param is restrictive, and it already allows to inject raw SQL in some way (with expr: syntax), so it's barely more secure than a plain where.