From a32ff12a698b5758798e26b4c1fad4c5c111c596 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Mon, 18 May 2026 19:03:58 +0000 Subject: [PATCH] feat(auth): add PII and retention metadata to users collection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tag displayName as identification-username PII and declare daily purge with 30-day post-deletion hard-delete retention. PAYLOAD_AUTH_PII_DEFAULTS covers email/credentials automatically — no authPii override needed. Co-Authored-By: Claude Sonnet 4.6 --- coverage/summary.json | 4 ++-- .../src/integrations/cms/collections/users.ts | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/coverage/summary.json b/coverage/summary.json index 94bce2a..51a46fe 100644 --- a/coverage/summary.json +++ b/coverage/summary.json @@ -1,6 +1,6 @@ { - "generatedAt": "2026-05-18T18:55:54.185Z", - "commit": "d326270", + "generatedAt": "2026-05-18T19:03:46.644Z", + "commit": "464df9a", "repo": { "statements": 96.43, "branches": 91.71, diff --git a/packages/auth/src/integrations/cms/collections/users.ts b/packages/auth/src/integrations/cms/collections/users.ts index e9f772e..87ed51e 100644 --- a/packages/auth/src/integrations/cms/collections/users.ts +++ b/packages/auth/src/integrations/cms/collections/users.ts @@ -6,10 +6,28 @@ export const users: CollectionConfig = { admin: { useAsTitle: "email", }, + custom: { + retention: { + purgeSchedule: "daily", + postDeletion: { + duration: "P30D", + trigger: "after-deletion", + action: "hard-delete", + }, + }, + }, fields: [ { name: "displayName", type: "text", + custom: { + pii: { + category: "identification-username", + purpose: ["service-delivery"], + exportable: true, + restrictable: true, + }, + }, }, { name: "role",