| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .. | ||
| INVENTORY.md | ||
| live-consumer-inventory.json | ||
| MIGRATION.md | ||
| openapi-v1.json | ||
| OPERATIONS.md | ||
| README.md | ||
| REPORT.md | ||
DuneRealms API v1 — initial read increment
Status: implemented against MC main 6e0f02e19ab88e32ade31d018e6362dbc07bb117; not deployed. Canonical proposed mount: https://cp.dunerealms.com/api/v1. Toggle API_V1_ENABLED=true explicitly enables it. No schema migration or game binary change is required. The default is disabled.
- OpenAPI 3.1 contract
- Endpoint and integration inventory
- Architecture and migration
- Deployment and rollback
- Observed live consumer evidence
- Maintainer coordination
Implemented requests
All five endpoints require the existing central website session. Sign in through the current website; this API does not receive passwords, mint independent identities or accept internal service tokens. Use same-origin browser requests with the existing HttpOnly cookie. No CORS access is granted. Ownership selectors and unknown/duplicate query parameters are rejected.
| GET endpoint | Data |
|---|---|
/api/v1/me |
Own account ID, username and display name |
/api/v1/me/minecraft |
Own verified link joined to the persistent game identity; otherwise linked:false |
/api/v1/me/permissions |
Existing effective permission nodes; informational, not a credential |
/api/v1/servers |
Public world-status projection, with unavailable/stale checks represented as unknown |
/api/v1/catalogue?limit=20&before=123 |
Existing native exchange listings; excludes kits and website perks |
Example success: {"data":{"id":"fixture-account","username":"example","displayName":"Example"},"meta":{"requestId":"server-generated-uuid"}}.
Example failure: {"error":{"code":"unauthenticated","message":"Sign in through the central website.","requestId":"server-generated-uuid"}} with status 401. Other statuses: 400 invalid query, 403 cross-origin/unsupported authorization, 404 unknown/disabled, 405 unsupported method, 429 throttled, 503 unavailable dependency/audit. Every response is private/no-store and correlated by X-Request-ID. The OpenAPI document specifies exact shapes.
Catalogue IDs and prices remain strings. Follow pagination.nextCursor as before; default limit 20, maximum 100. Native listings remain mutable, so paging is a live view, not a snapshot. The old bridge exposes only its latest 500 rows: sourceLimited:true signals reaching that cap. Do not treat this as a complete catalogue export. No currency conversion, debit or delivery occurs.
Security and limits
Session lookup and permission resolution reuse node/auth.mjs and node/permissions.mjs. No role definitions, rank assignments, linking challenges, rewards or transaction ledgers are changed. A stored link without the verified identity record is not exposed as verified. Caller UUID, account and scope overrides are rejected. The API has no administrative endpoints, so support access cannot imply appeal approval or administration through v1.
The initial permission response explicitly says legacy-effective-nodes: main lacks the deployed Website/Community/Minecraft/Network and department/server scope model. This is an unresolved deployment dependency, not a substitute scoped policy. Do not use this output to authorize future privileged operations.
The existing private read bridge is called only from the server using EXCHANGE_LISTINGS_URL and EXCHANGE_READ_TOKEN. HTTPS, no redirects, timeout, bounded payload, strict response projection and exact decimal validation apply. The fixed configured URL is never caller-controlled. Tokens, bodies, cookies and query values do not enter request audit events. Browser responses contain only allowlisted fields. Existing game bridge service authentication stays in place unchanged.
Conservative fixed-window limit: 120 requests per process globally and 120 per account per minute; 5,000 maximum buckets, no trusted client IP headers. This deliberately low single-process budget is for the initial staged increment. Agree deployment capacity and shared edge/account limiting before multi-instance rollout; restarting resets the in-memory limiter. Failed audit writes fail the v1 request closed. Default request events go to structured process output; operators must configure restricted durable collection and retention. No new privileged actions exist in this increment; later mutations require transactional privileged audit/outbox records before enablement.
Validation
Use Node 22+ with SQLite support (validated with Node 24), then from website/:
pnpm install --frozen-lockfile --ignore-scripts
node --test tests/api-v1.test.mjs tests/account-inventory.test.mjs tests/rank-permissions.test.mjs tests/world-status.test.mjs
Tests use isolated SQLite fixtures with real session lookup, verified-link queries, existing permission resolver and the panel router, plus an injected native bridge. They cover expiry, forged headers, cross-account and UUID overrides, support boundaries, pagination, precision, sanitized errors, failure recovery, duplicate/concurrent reads, mutation rejection, rate-window recovery, auditing and old-route compatibility. Financial/delivery concurrency and crash recovery are not proven by read-only tests; existing native tests and new isolated service integration tests are required before migrating mutations.

Staff