Skip to content

✨ Add purge event for age assurance data for compliance#4709

Merged
foysalit merged 4 commits intomainfrom
delete-aa-events
Mar 12, 2026
Merged

✨ Add purge event for age assurance data for compliance#4709
foysalit merged 4 commits intomainfrom
delete-aa-events

Conversation

@foysalit
Copy link
Contributor

@foysalit foysalit commented Mar 3, 2026

For compliance reasons, we need to be able to purge all AA related data upon user request. This PR introduces a purge event for AA data which deletes the user generated AA events from ozone db. The intent is for other microservices to do the same upon receiving this new purge event.

await this.db.db
.deleteFrom('moderation_event')
.where('subjectDid', '=', subjectDid)
.where('action', '=', 'tools.ozone.moderation.defs#ageAssuranceEvent')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also delete tools.ozone.moderation.defs#ageAssuranceOverrideEvent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the override event is not user generated and does not contain any user info so i'm inclined to keep those.

)

if (isAgeAssurancePurgeEvent(event)) {
await this.purgeAgeAssuranceEvents(subjectInfo.subjectDid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the purge happen after the moderation_event insert in case it fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that's what we're doing here, the event insert happens above this line.

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from my limited knowledge of this codebase 👍

Copy link
Contributor

@gcwill70 gcwill70 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments to consider

@foysalit foysalit merged commit 9f9f71a into main Mar 12, 2026
20 checks passed
@foysalit foysalit deleted the delete-aa-events branch March 12, 2026 15:02
@github-actions github-actions bot mentioned this pull request Mar 11, 2026
estrattonbailey added a commit to bluesky-social/indigo that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants