feat(registry): premium items: catalog, entitlements and signed tickets #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/entitlements"
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?
Phase 1 of the premium-content plan: the registry keeps a catalog of premium items and what each account owns, and signs a short-lived ticket a game server checks.
migrations/0004_entitlements.sql:catalog_items(PK game+item_id) andentitlements(account FK with ON DELETE CASCADE, FK to the catalog item, unique (source, receipt_id),revoked_at).catalog.json(empty for now) is upserted at boot; items missing from it are marked inactive, never deleted. A malformed file stops boot.GET /api/v1/catalog[?game=](public),GET /api/v1/entitlements/me[?game=]andPOST /api/v1/entitlements/ticket[?game=](account),POST /api/v1/entitlements/verify(server or host token),POST|DELETE /api/v1/admin/entitlements(ADMIN_TOKEN).ENTITLEMENT_SECRET(at least 32 chars, shorter stops boot, unset turns tickets off with 503, as ACCOUNT_PEPPER does for accounts),ENTITLEMENT_TICKET_SEC(default 300).entitlements_test.go: catalog filter and retire, grant/list/revoke, a receipt grants once, cascade on account delete, ticket round trip, expired and tampered tickets, wrong auth, tickets off.Removed: nothing; this is new.
go vet ./...andgo test ./...pass locally. Release tag and the home-config bump come after merge.https://claude.ai/code/session_01BALUC4Q8G6QL3byFZR6Mhu