feat: GDPR PII Export/Delete Workflow#661
Open
chengyixu wants to merge 1 commit intorohitdash08:mainfrom
Open
Conversation
…ash08#76) Implements full GDPR compliance with: - Data export endpoint (GET /gdpr/export) - downloads all user PII as JSON - Account deletion with 30-day grace period (POST /gdpr/delete) - Immediate irreversible deletion (POST /gdpr/delete/confirm) - Deletion cancellation during grace period (POST /gdpr/delete/cancel) - Data anonymization alternative (POST /gdpr/anonymize) - Immutable GDPR audit trail logging (survives user deletion) - Admin audit log viewer (GET /gdpr/audit-logs) - Frontend Privacy & Data page with export/anonymize/delete UI - 20 comprehensive tests covering all workflows - OpenAPI spec updated with all new endpoints Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
/claim #76
Summary
Full GDPR-compliant PII export, deletion, and anonymization workflow:
GET /gdpr/export): Downloads all user personal data as structured JSON (profile, expenses, categories, bills, recurring expenses, reminders, subscriptions, audit logs)POST /gdpr/delete): 30-day grace period with password re-confirmation, cancellable viaPOST /gdpr/delete/cancelPOST /gdpr/delete/confirm): Cascading hard-delete across all user-owned tables with password verificationPOST /gdpr/anonymize): Replaces PII with anonymous placeholders while preserving financial records for users who want history keptgdpr_audit_logstable with no FK to users (survives deletion), logging every export/delete/anonymize action with IP, user agent, timestamp, and detailsGET /gdpr/audit-logs): Paginated, filterable by user, admin-only accessGET /gdpr/delete/status): Check if a deletion request is pendingChanges
packages/backend/app/models.pyGdprAuditLogandDeletionRequestmodelspackages/backend/app/db/schema.sqlgdpr_audit_logsanddeletion_requeststables with indexespackages/backend/app/services/gdpr.pypackages/backend/app/routes/gdpr.py/gdpr/with JWT auth and password verificationpackages/backend/app/routes/__init__.pygdpr_bpblueprintpackages/backend/app/openapi.yamlpackages/backend/tests/test_gdpr.pyapp/src/api/gdpr.tsapp/src/pages/Privacy.tsxapp/src/pages/Account.tsxapp/src/App.tsx/privacyrouteTest plan
🤖 Generated with Claude Code