mancala/apps/backend/package.json
Halit Aksoy 30ad51c493 feat(backend): authenticate WebSocket clients with Keycloak tokens
- New auth module verifies Keycloak access tokens offline against the
  realm's signing keys (issuer, RS256, typ=Bearer, allowed azp); guests
  are recognised by the guest realm role
- Clients send an auth message after connecting and get on_auth or
  on_auth_error; unauthenticated sockets are closed after 5 seconds and
  their messages ignored; a socket can refresh its token but not switch user
- A user can be connected from several sockets; a late close of an old
  socket no longer drops the new one
- Malformed messages are ignored instead of throwing
- Games store player names and guest flags and send them with the
  connection info
- Legacy ?userKey= clients and /register stay available behind
  LEGACY_USERKEY_AUTH; legacy keys must be UUIDs so they cannot take a
  Keycloak user's kc: id
- TypeScript target raised to es2020 for async/await
2026-10-14 01:52:07 +03:00

41 lines
910 B
JSON

{
"name": "@mancala/backend",
"version": "0.4.7",
"description": "",
"main": "index.js",
"scripts": {
"start": "node dist/index.js",
"dev": "nodemon src/index.ts",
"build": "tsc",
"test": "jest",
"coverage": "jest --coverage"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@mancala/core": "0.0.2",
"@types/cors": "^2.8.10",
"@types/morgan": "^1.9.3",
"@types/uuid": "^8.3.0",
"@types/ws": "^7.4.5",
"cors": "^2.8.5",
"express": "^4.17.1",
"jose": "5.10.0",
"mancala.js": "^0.0.2-beta.3",
"morgan": "^1.10.0",
"uuid": "^8.3.2",
"ws": "^7.5.0"
},
"devDependencies": {
"@types/express": "^4.17.12",
"@types/jest": "^26.0.23",
"@types/node": "^15.12.4",
"jest": "^27.0.5",
"nodemon": "^2.0.7",
"ts-jest": "^27.0.3",
"ts-node": "^10.0.0",
"typescript": "^4.7.4"
}
}