Let admins delete a signed-in user's account

Aperta
#4,271 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@anth-volk ci sta già lavorando.

Dal 10/11/2026.

  • #4272 di @anth-volk — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Start with the existing DELETE /v2/me handler and the admin user routes under /v2/admin/users; the issue names no file or test paths. Trace the deletion transaction, Auth0 cleanup, and advisory lock checks, then inspect the linked pull request #4272 for work already underway. Done means the admin route and shared deletion behavior meet the listed status, authorization, logging, and Auth0 cleanup requirements.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Admins can list signed-in users, read one, change their types and read their type history under /v2/admin/users (#4261), but cannot delete a user's account. Users can delete only their own, with DELETE /v2/me.

Add DELETE /v2/admin/users/{user_id} so that an admin can delete another signed-in user's account and saved records, including the Auth0 users of its sign-in identities, exactly as DELETE /v2/me deletes one's own:

  • prepare the Auth0 Management deleter before touching data (503 with nothing deleted when it can't be prepared);
  • 204 on success, 502 when an Auth0 deletion fails after the data is gone, 404 for an absent or unauthenticated user ID, 409 for the last admin;
  • after the data is deleted, try every one of the account's Auth0 users before reporting a failure, for this route and for DELETE /v2/me, and say how many remain;
  • admins only (403 below admin): the router's admin check, plus a check inside the deletion's own transaction under the user-type change advisory lock, as type changes do;
  • an admin deleting their own account through this route follows the same last-admin rule as DELETE /v2/me;
  • record each deletion as a log event naming the admin's and the deleted user's v2 IDs, never emails or tokens;
  • share the deletion logic with DELETE /v2/me rather than copying it.
Lingua principale
Python
Stelle
18
Fork
33
Merge medio
2g 10h
PR unite (30g)
124

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PolicyEngine/policyengine-api

Tutte le issue di PolicyEngine/policyengine-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.