What it does
๐ค
Users
Register a username, get a user_key.
๐ช
Shops
Register a unique shop name, get a shop_key.
๐๏ธ
Shop users
Join a shop (with your user_key), get an api_key for that shop.
โ
Verify
Check any key. Answer is {"valid": true|false}.
๐งน
Remove
A shop deletes itself with its shop_key (reset).
๐
Private
Keys shown once, stored only as SHA-256 hashes.
Players
1. Register (once). Save the user_key: it is shown only once.
curl -s -X POST https://msampathkumar.com/demos/build-your-pc/registry/users \
-H 'content-type: application/json' -d '{"username": "you"}'
2. Join a shop. You get an api_key for that shop only.
curl -s -X POST https://msampathkumar.com/demos/build-your-pc/registry/shop-users \
-H 'content-type: application/json' \
-d '{"username": "you", "user_key": "usr_...", "shop_name": "silicon-forge"}'
3. Shop with your username + that api_key (headers X-Username, X-API-Key).
Shops and services
POST /shops: register a shop name, get ashop_key(shops do this on first start).POST /verify/user,/verify/shop,/verify/shop-user: check keys. Wrong keys get{"valid": false}.DELETE /shops/{name}withX-Shop-Key: remove a shop (used by reset).
Paths are relative to https://msampathkumar.com/demos/build-your-pc/registry. Every request and reply is JSON.