feat(registry): admin player routes: search, read one account, restore, delete saves or the account #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/registry-admin-players"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rewards-admin P1: the admin site can find a player, read everything kept for them, and restore or delete their saves or the whole account. No schema change. The page that uses these routes is P2.
What changed
deleteAccount(ctx, id, first)anddeleteSaves(tx, id)come out ofhandleDeleteAccount;DELETE /api/v1/accounts/meand the admin delete run the same code.restore(...)andrestoreDone(...)come out ofrestoreSnapshot; the player's restore and the admin restore share them. The lease precheck outside the transaction is gone (the in-tx check does the same job); a refused restore of a running world now always answers409withholderandexpires.adminplayers.go):GET /api/players?q=,GET /api/players/{account},GET .../snapshots/{snapshot},POST .../{characters|worlds}/{id}/restore,DELETE .../characters/{id}(soft),DELETE .../saves,DELETE /api/players/{account}.override_auditrow, channelplayer, with the account id as the game. A delete row holds only counts, so it names no player data once the account is gone.Assumptions
accountfield. The game'sWebAdminRosterdoes not send that field yet, so the list stays empty until the game adds it (P4 work, unity-core-playground).PATCH /api/players/{account}(name, title) in P1. Title arrives with P5, and the plan lists the title edit in P7.Checks
go vet ./...andgo test -count=1 -v ./...in golang:1.24, against throwaway postgres:17.6-alpine and minio: 108 PASS, 0 FAIL. That includes 7 new tests (TestAdminPlayer*: sign-in gating and not on the public port, search by id, name and code, one account's view holds none of another's, presence from the roster, snapshot body and restore including a 409 on a moved head and on a leased world, delete character, delete saves, delete account plus their audit rows). The existingTestAccountDelete,TestCharacterSnapshotsandTestWorldRestoreAndForkstill pass on the extracted code. gofmt is clean. This repo has no PR CI.Nothing removed beyond the inlined copies the extraction replaced.
https://claude.ai/code/session_01BALUC2TweemuC6uuKqXygb