Skip to content

Enforce privacy settings at runtime and expand data export/deletion test coverage#174

Merged
Kaylahray merged 1 commit into
artisyn-io:mainfrom
phertyameen:feat/dataRetentionMonths__#162_#163_#164
Apr 28, 2026
Merged

Enforce privacy settings at runtime and expand data export/deletion test coverage#174
Kaylahray merged 1 commit into
artisyn-io:mainfrom
phertyameen:feat/dataRetentionMonths__#162_#163_#164

Conversation

@phertyameen

Copy link
Copy Markdown

Closes #162, #163, #164

What changed

#162 – Data retention lifecycle (DataRetentionJob)
Added DataRetentionJob with a run() batch method (nightly cron) and enforceForUser() for on-demand sweeps. Deletes audit logs, authored reviews, and sent tips older than the user's dataRetentionMonths cutoff. Emits an audit event when rows are removed.

#163 – Privacy flag enforcement (PrivacyGuard)
Added PrivacyGuard with typed guards for searchEngineIndexing, allowDirectMessages, and allowProfileComments. getPublicProfile now sets X-Robots-Tag based on the user's indexing preference. The two message/comment guards are ready to be called by those controllers as those features land.

#164 – HTTP integration tests for export and deletion
Added data-export-http.test.ts covering all 7 routes: auth enforcement, status codes, response envelopes, pagination, authorization isolation between users, and the full deletion lifecycle (schedule → duplicate guard → cancel in-app → cancel via email token → cross-user rejection).

Tests added

  • src/services/__tests__/DataRetentionJob.test.ts (7 tests)
  • src/services/__tests__/PrivacyGuard.test.ts (12 tests)
  • src/controllers/__tests__/data-export-http.test.ts (28 tests)

closes #162
closes #163
closes #164

@phertyameen
phertyameen force-pushed the feat/dataRetentionMonths__#162_#163_#164 branch from 58d698f to 621a973 Compare April 27, 2026 23:15
@Kaylahray
Kaylahray merged commit 1d53fd7 into artisyn-io:main Apr 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants