Repository navigation
v0.12.0
Root module: v0.12.0, directory/v0.3.0. Additive; no migration.
GDPR deletion receiver. Registre now erases a person on request and tells each app. Until an app
acts on that, it keeps the data and breaks the erasure promise. directory.Deletions is the
receiver: it polls GET /api/directory/deletions, accepts Registre's signed user.deleted push, and
calls OnPersonDeleted(ctx, provider, subject) once per person. pg.Store.EraseIdentity erases
porte's own rows (identity with its provider tokens, sessions, named tokens, login codes, magic
links) and is wired as Deletions.Erase.
- Polling is the source of truth. Registre keeps a notice for 60 days and lists 1000 per call.
Pollpages through the list in one call. The receiver persists a cursor plus every handled subject
through aStateStorethe app implements over one row, asforfait.Store.Exportdoes for plans.
A failing callback or erase leaves that person pending and does not block the others: the rest are
handled, the cursor stays before the earliest failure, and the errors come back joined. The next
poll or Registre's retry tries again. Run exactly one replica'sRun. Delivery is at least once, so
OnPersonDeletedmust be idempotent. The handled-subject record is why a push followed by a poll,
or a replayed push, reaches the callback once. - The push is optional and verified.
Handler()accepts onlytypsecevent+jwt, RS256 from the
issuer's JWKS, the rightissandaud, a short time window and theuser-deletedevent, else 400.
The discovery document must name the configured issuer,jwks_urimust be https (unless the issuer
is plain http) and key fetches follow no redirects. A key-fetch failure or akidunknown inside
the one-minute refetch gap answers 503 so Registre retries. Mount it onDeletionsPathand set that
URL as the client'sdeletion_uriin Registre. Never on
SyncPath: the sync handler answers 202 to any POST. - The callback runs before
Erase, so the app can still resolve its account from porte's
identity rows.EraseIdentityremoves only that one identity and leavesporte_usersand the
account's other identities to the app. directory.ClientgainedDeletions(ctx, since).directorystays standard-library only.
Upgrade note for apps: bump porte to v0.12.0 and porte/directory to v0.3.0, implement
StateStore (load and save one blob), write OnPersonDeleted to delete the account and its data,
then run (&directory.Deletions{Client, OnPersonDeleted, Erase: store.EraseIdentity, State}).Run(ctx)
next to the Syncer. Optionally mount Handler() and register the deletion_uri.