-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: Long term storage of Webform submission data #95
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
Conversation
Long term storage of Webform submission data in an off-site database. Work in progress.
Alternate Webform submission entity storage class for storing and retrieving entities from the LTS database.
- PHP class to copy Webform submissions to Long term storage. - Cron job to periodically copy Webform submissions to Long term storage. - Deploy hook to copy Webform submissions to Long term storage. - Personally Identifiable Information redaction before copying Webform submissions to Long term storage. - A requirement hook implementation to warn against misconfiguration.
Fixed return value of LtsCopy::findCopyTargets(). Also, ensured that no Webform handlers run while Webform submissions are copied to Long term storage.
Updated scope of Personally Identifiable Information.
Listing and viewing Webform submissions in Long term storage.
Fix for Personally Identifiable Information redaction. Date elements from this module were unaccounted for.
Spots and redacts any email address, postcode, and number within the text value of a textarea field.
Tests following functionalities: - LtsCopy's ability to copy both new and existing Webform submissions. - LtsStorageForWebformSubmission's ability to copy into the LTS database. - PIIRedactor's ability to correctly identify which Webform fields should be redacted.
PHPStan is incorrectly inferring the type of the $entity_type object used within _localgov_forms_lts_get_webform_submission_storage_schema(). Inferred type is Drupal\Core\Entity\EntityTypeInterface. Expected type is Drupal\Core\Entity\ContentEntityTypeInterface. Actual type is Drupal\Core\Entity\ContentEntityType which is an instance of Drupal\Core\Entity\ContentEntityTypeInterface.
|
Very cool @Adnan-cds . One question, if we're removing / redacting personal information, what's the motivation for storing the data in a separate database? |
This is primarily for reporting. The idea is, you connect the separate database with a reporting or data warehousing tool for further reporting and analysis. |
…ddev-testing Feature/long term storage ddev testing
|
@stephen-cox @ekes any chance of a quick code review on this one for @Adnan-cds ? |
|
@ekes is happy to read review the code this week. |
|
Discussing with @ekes and @Adnan-cds The code looks good in general! Discussing use cases, we think that it might be usefult to separate the redaction from the storage in a separate database: a) some people might want redaction before storing int he Drupal database. Also noting that this module was released today: https://www.drupal.org/project/webform_sanitize_submissions and there is also https://www.drupal.org/project/webform_sanitize |
We should have a choice of PII redaction plugins before saving Webform submissions in the long term storage database. WIP.
…feature/long-term-storage
Moved PII redaction functionality from the localgov_forms_lts submodule into the localgov_forms module in the form of a plugin.
Adding the `localgov_forms_lts:copy` Drush command. This command copies all existing Webform submissions into the Long Term Storage (LTS). This is particularly useful soon after the localgov_forms_lts module has been installed.
A config form for: - Activating or deactivating copying to LTS database. - Selecting a PII redactor plugin if PII redaction is necessary.
These constants represent the newly added localgov_forms_lts module configuration.
|
Changes since last review:
Ready for review once again. @finnlewis @ekes |
ekes
left a comment
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.
🤯
Well it works, and it was copying stuff over to my database. Code review we've already discussed. So we're good there. I was wondering if it was possible to use the sample plugin PII redaction per-form; but I'm guessing not yet.
|
Thanks for the review and approval. Must have taken a good few hours :(
That's right. There is no per-form config settings. At some point, I would like to write another plugin that can be activated for each field in a Webform. But at this point, we just want to find out if this submodule runs into any unforeseen issues at scale. |
What does this change?
Adds a submodule to store Webform submission data into a separate database for long term storage (LTS).
Personally identifiable information (PII) is optionally redacted before copying into the LTS database.
How to test
Please see the Setup and Inspection sections of the README.
How can we measure success?
Webform submissions should get copied into the LTS database during cron runs.
Have we considered potential risks?
PII redaction may miss relevant pieces information. Current redaction rules are as follows: