This PR addresses issue #1451 by ensuring strict GDPR compliance in the data export functionality. It ensures the export includes only requester-owned data and properly redacts private counterpart identifiers from exported entities to prevent data leaks.
src/data-export/data-export.service.ts:- Expanded the
compileUserDatafunction to fetch and exportTips,Reports, andModerationLogsbelonging to the requesting user. - Added new redaction policies (
redactTipForExport,redactReportForExport,redactModerationLogForExport) that mask counterpart identifiers (e.g., wallet addresses, resolver IDs, reviewer IDs) to[REDACTED]. - Ensured all exported data strips nested counterpart objects and explicitly flags elements for
counterpart_privacy.
- Expanded the
src/data-export/data-export-redaction.spec.ts:- Added test fixtures for
Tips,Reports, andModerationLogs. - Verified that all counterpart identifiers are properly redacted before export generation.
- Added test fixtures for
- Export includes requester-owned data only.
- Private counterpart identifiers are redacted.
- Tests cover all sensitive entity types.
- Run backend tests specifically targeting the data export module:
npm run backend:test -- --runTestsByPath src/data-export/* - Validate that the tests pass and counterpart fields correctly return
[REDACTED]. - Generate a sample export and verify that unrelated counterpart identities are hidden from the final payload.
Closes #1451