mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Add authentication plugin that does a simple challenge response protocol to verify that the player trying to log in is who they claim to be. The process goes as follows: 1. A player code is generated for a player that wants to log in and is displayed in-game. 2. The player code is input into the web interface and the master generates a verification code as a challenge back along with a token. 3. The player inputs the verification code in-game and is logged in to the web interface in doing so. To do the actual login the web interface polls a verify endpoint every 2 seconds until the code has either been verified or expired. The challenge comes from being unable to control the verification code and having to input it as a player logging into one of the servers in order to login. Some additional steps are taken in order to increase the difficulty for an attacker to subvert the challenge: - The login process must be started from in-game. - Generated codes are only valid for a limited timespan which is configurable and 2 minutes by default. - The verification code comes with a token that only works with one player code and verification code combo and must be provided to pass validation.
43 lines
1.2 KiB
JSON
43 lines
1.2 KiB
JSON
{
|
|
"name": "root",
|
|
"private": true,
|
|
"scripts": {
|
|
"test": "mocha --check-leaks -R spec --recursive test plugins/global_chat/test plugins/research_sync/test plugins/statistics_exporter/test plugins/subspace_storage/test plugins/player_auth/test",
|
|
"fast-test": "FAST_TEST=y npm test",
|
|
"cover": "nyc npm test",
|
|
"fast-cover": "FAST_TEST=y nyc npm test",
|
|
"ci-cover": "nyc --reporter=lcovonly npm run-script test",
|
|
"lint": "eslint \"*.js\" packages plugins test",
|
|
"docs": "jsdoc --configure docs/jsdoc.json",
|
|
"bundle-dependencies": "bundle-dependencies"
|
|
},
|
|
"nyc": {
|
|
"exclude": [
|
|
"test/**",
|
|
"plugins/*/test/**"
|
|
]
|
|
},
|
|
"engines": {
|
|
"node": ">=10.16 <11 || >= 12"
|
|
},
|
|
"devDependencies": {
|
|
"@clusterio/ctl": "file:./packages/ctl",
|
|
"@clusterio/lib": "file:./packages/lib",
|
|
"@clusterio/master": "file:packages/master",
|
|
"@clusterio/slave": "file:./packages/slave",
|
|
"body-parser": "^1.18.2",
|
|
"eslint": "^7.2.0",
|
|
"express": "^4.16.2",
|
|
"fs-extra": "^8.1.0",
|
|
"jsdoc": "^3.6.3",
|
|
"jsonwebtoken": "^8.2.1",
|
|
"jszip": "^3.2.2",
|
|
"lerna": "^3.22.1",
|
|
"mocha": "^6.2.0",
|
|
"node-forge": "^0.10.0",
|
|
"nyc": "^14.1.1",
|
|
"phin": "^3.4.1",
|
|
"webpack": "^5.0.0"
|
|
}
|
|
}
|