-
Notifications
You must be signed in to change notification settings - Fork 2
Add ability to remove/anonymise user data #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JeremySkinner
wants to merge
16
commits into
feature/gdpr-tasks
Choose a base branch
from
feature/gdpr-tasks-remove
base: feature/gdpr-tasks
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c74d730
Initian implementation of anonymization/removal logic for GDPR.
JeremySkinner e4a9e70
Ensure entity cache is bypassed when modifying fields as part of anon…
JeremySkinner 7d5f84c
Switch from event to custom hook for anonymizers
JeremySkinner 70f6297
Suppress error if cache hasn't been initialized yet
JeremySkinner ad47726
Implement anonymization of base User fields and account blocking
JeremySkinner 82bd0cb
Add edit link for maybe fields in RTF
JeremySkinner 722e8fb
Move status fields to the Task. Store processed by on the task.
JeremySkinner 2638016
Introduce TaskLogItem to log which fields were changed by Remove tasks.
JeremySkinner 906259e
Switch to using the existing sanitizer infrasturcture.
JeremySkinner aa30efa
Fix typos in GdprSanitizer ID definitions
JeremySkinner 8a77cad
Update field label for sanitizer
JeremySkinner dba2706
Add log field for sanitizer.
JeremySkinner 4a27249
Ensure sanitizer used is logged. Cleanup
JeremySkinner 42609c3
Doc comments and tweaks from code review
JeremySkinner a4117aa
Add export functionality on completion of RTF task.
JeremySkinner a515bb2
Tidy up
JeremySkinner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
modules/gdpr_dump/src/Plugin/Gdpr/Sanitizer/DateSanitizer.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <?php | ||
|
|
||
| namespace Drupal\gdpr_dump\Plugin\Gdpr\Sanitizer; | ||
|
|
||
| use Drupal\Component\Utility\Random; | ||
| use Drupal\Core\Field\FieldItemListInterface; | ||
| use Drupal\gdpr_dump\Sanitizer\GdprSanitizerBase; | ||
|
|
||
| /** | ||
| * Class TextSanitizer. | ||
| * | ||
| * @GdprSanitizer( | ||
| * id = "gdpr_date_sanitizer", | ||
| * label = @Translation("Date sanitizer"), | ||
| * description=@Translation("Provides sanitation functionality intended to be used for datetime fields.") | ||
| * ) | ||
| * | ||
| * @package Drupal\gdpr_dump\Plugin\Gdpr\Sanitizer | ||
| */ | ||
| class DateSanitizer extends GdprSanitizerBase { | ||
|
|
||
| /** | ||
| * {@inheritdoc} | ||
| */ | ||
| public function sanitize($input, FieldItemListInterface $field) { | ||
| return '1000-01-01'; | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
modules/gdpr_dump/src/Plugin/Gdpr/Sanitizer/RandomTextSanitizer.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <?php | ||
|
|
||
| namespace Drupal\gdpr_dump\Plugin\Gdpr\Sanitizer; | ||
|
|
||
| use Drupal\Component\Utility\Random; | ||
| use Drupal\Core\Field\FieldItemListInterface; | ||
| use Drupal\gdpr_dump\Sanitizer\GdprSanitizerBase; | ||
|
|
||
| /** | ||
| * Class TextSanitizer. | ||
| * | ||
| * @GdprSanitizer( | ||
| * id = "gdpr_random_text_sanitizer", | ||
| * label = @Translation("Random Text sanitizer"), | ||
| * description=@Translation("Provides sanitation functionality intended to be | ||
| * used for text fields.") | ||
| * ) | ||
| * | ||
| * @package Drupal\gdpr_dump\Plugin\Gdpr\Sanitizer | ||
| */ | ||
| class RandomTextSanitizer extends GdprSanitizerBase { | ||
|
|
||
| /** | ||
| * {@inheritdoc} | ||
| */ | ||
| public function sanitize($input, FieldItemListInterface $field) { | ||
| if ($field != NULL) { | ||
| $max_length = $field->getDataDefinition()->getSetting("max_length"); | ||
| } | ||
|
|
||
| $value = ''; | ||
|
|
||
| if (!empty($input)) { | ||
| // Generate a prefixed random string. | ||
| $rand = new Random(); | ||
| $value = "anon_" . $rand->string(4); | ||
| // If the value is too long, tirm it. | ||
| if (isset($max_length) && strlen($input) > $max_length) { | ||
| $value = substr(0, $max_length); | ||
| } | ||
| } | ||
| return $value; | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, can you stick a
@todoin here to remove the gdpr_task specific continue once we have solved the concept of 'ignore/excluded' relationships and entity types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.