feat(registry): an entitlement ticket verifies once #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/ticket-used-once"
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?
A ticket could be presented by any connection until it expired (playground #1715, docs/operations/premium-content.md, Open).
POST /api/v1/entitlements/verifynow spends it.used_tickets(migration 0009) holds the signature of each verified ticket. The insert decides a race, so one of two verifies wins. Rows of expired tickets are cleared on each verify, so no new sweep.nonce: without one, two tickets made in the same second are the same string and the second would read as used.recordSessionAccount, so a replay records nothing.assumed: single use rather than an account match, because a game server knows no account for a connection except the one in the ticket, and a client-sent id can be read out of the ticket and forged.
Not closed: a modded client can still give a friend an unspent ticket, one friend per ticket.
Tested:
go test ./...green in golang:1.24 with Postgres and MinIO, gofmt and vet clean.TestTicketVerifiesOncewent red with the used check disabled.Removed: nothing; this adds a check the route did not have.
Live registry is v1.11.0, which has no entitlement routes yet, so this rides the pending premium release. No tag or deploy here.
https://claude.ai/code/session_01BALUC3rdg9oGzE5xsFNU2D