Add user and permission system

Add users, roles and permissions and rework the authentication to use
separate user and slave tokens for control and slave connections
respectively.

Add commands for listing permissions, roles and users, and creating,
editing and deleting roles and users.
This commit is contained in:
Hornwitser committed 2020-06-15 16:47:15 +02:00
1 parent 2acf57d23d
commit cf6f2cb70a
20 files changed
+1511 -153

No files matched your search

+11 -3
View File
@@ -156,6 +156,14 @@ class Instance extends link.Link{
console.error("Error handling autosave-finished:", err);
});
});
this.server.on("ipc-player_event", event => {
link.messages.playerEvent.send(this, {
instance_id: this.config.get("instance.id"),
...event,
});
plugin.invokeHook(this.plugins, "onPlayerEvent", event);
});
}
async _autosave(name) {
@@ -1181,10 +1189,10 @@ async function startSlave() {
if (slaveConfig.get("slave.master_token") === "enter token here") {
console.error("ERROR invalid config!");
console.error(
"Master server now needs an access token for write operations. As clusterio\n"+
"Master server requires an access token for socket operations. As clusterio\n"+
"slaves depends upon this, please set your token using the command node slave\n"+
"config set slave.master_token <token>. You can retrieve your auth token from\n"+
"the master in secret-api-token.txt after running it once."
"config set slave.master_token <token>. You can generate an auth token using\n"+
"using node clusterctl generate-slave-token."
);
process.exitCode = 1;
return;