Add GDPR-compliant PII export and deletion workflow#355
Open
addidea wants to merge 1 commit intorohitdash08:mainfrom
Open
Add GDPR-compliant PII export and deletion workflow#355addidea wants to merge 1 commit intorohitdash08:mainfrom
addidea wants to merge 1 commit intorohitdash08:mainfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #76
What
I built a complete GDPR compliance module that lets users export their personal data and request permanent deletion. The addation covers JSON and CSV export formats, secure deletion with audit trails, and a service layer that handles PII responsibly throughout.
Why
We needed to meet GDPR requirements for data portability and the right to be forgotten. The existing system had no systematic way to handle these requests, which put us at compliance risk. I wanted to build something that actually protects user privacy rather than just checking boxes.
How
I structured this as a dedicated module with clear separation of concerns:
For exports, I gather all PII across related tables and format it as either machine-readable JSON or human-readable CSV. The deletion path uses soft-delete with a grace period, then hard removal after verification, with full audit trails at each step.
I paid special attention to edge cases: what happens when a user has active subscriptions, shared content, or legal holds. The service layer checks these conditions before proceeding.
The audit logs are append-only and include request metadata, execution timestamps, and anonymized user identifiers. This gives us defensible records without creating new PII risks.
I also added rate limiting on deletion requests to prevent abuse, and confirmation flows that require explicit user consent.
All new code includes unit tests and follows the existing linter rules. I checked requirements.txt before starting to avoid dependency conflicts, and the branch is rebased on latest main.
Happy to adjust the export schemas or retention policies based on feedback.