Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Shopware 6 anonymization does not anonymize completely #89

Open
peterjaap opened this issue Nov 28, 2021 · 4 comments
Open

Shopware 6 anonymization does not anonymize completely #89

peterjaap opened this issue Nov 28, 2021 · 4 comments

Comments

@peterjaap
Copy link
Contributor

peterjaap commented Nov 28, 2021

But for some reason it duplicates the to-be-anonimized record and anonimizes that one. Maybe because of the binary UUID's?

But not all tables. customer, customer_address, newsletter_recipient, user, etc seem to be unaffected. order_customer and order_address contain the duplicate records.

@peterjaap
Copy link
Contributor Author

peterjaap commented Nov 28, 2021

order_customer and order_address table seems to contain multiple records with the same id ?

image

@peterjaap peterjaap changed the title Shopware 6 anonimization does not anonimize Shopware 6 anonymization does not anonymize Nov 28, 2021
@peterjaap peterjaap changed the title Shopware 6 anonymization does not anonymize Shopware 6 anonymization does not anonymize completely Nov 28, 2021
@peterjaap
Copy link
Contributor Author

I guess the problem stems from here, where MySQL doesn't recognize it as an existing row and inserts a new one; https://github.com/elgentos/masquerade/blob/master/src/Elgentos/Masquerade/DataProcessor/TableService.php#L378

@peterjaap
Copy link
Contributor Author

peterjaap commented Nov 28, 2021

Probably because the table has two primary keys and Masquerade identifies the wrong one;

mysql> describe order_customer;
+------------------+--------------+------+-----+---------+-------+
| Field            | Type         | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| id               | binary(16)   | NO   | PRI | NULL    |       |
| version_id       | binary(16)   | NO   | PRI | NULL    |       |
| customer_id      | binary(16)   | YES  | MUL | NULL    |       |
| order_id         | binary(16)   | NO   | MUL | NULL    |       |
| order_version_id | binary(16)   | NO   |     | NULL    |       |
| email            | varchar(254) | NO   |     | NULL    |       |
| salutation_id    | binary(16)   | NO   | MUL | NULL    |       |
| first_name       | varchar(255) | NO   |     | NULL    |       |
| last_name        | varchar(255) | NO   |     | NULL    |       |
| title            | varchar(100) | YES  |     | NULL    |       |
| company          | varchar(255) | YES  |     | NULL    |       |
| customer_number  | varchar(255) | YES  |     | NULL    |       |
| custom_fields    | json         | YES  |     | NULL    |       |
| created_at       | datetime(3)  | NO   |     | NULL    |       |
| updated_at       | datetime(3)  | YES  |     | NULL    |       |
| remote_address   | varchar(255) | YES  |     | NULL    |       |
+------------------+--------------+------+-----+---------+-------+

@peterjaap
Copy link
Contributor Author

This problem occurs because Masquerade at this point assumes a table only has one primary key. @IvanChepurnyi any idea how to allow for multiple PK's?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant