mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Move all functions and classes currently available through lib/name and libName to be under a single flat namespace in lib. This make reorganising the lib namespace much simpler as the location of symbols can move without breaking the consumers of lib. The multi-entrypoint design was already problematic for the web plugin system which couldn't effectively use it due to how webpack's shared module system is awkward to set up with multiple entrypoints per package.
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
"use strict";
|
|
const lib = require("@clusterio/lib");
|
|
let messages = require("./messages");
|
|
|
|
|
|
class ControllerConfigGroup extends lib.PluginConfigGroup {}
|
|
ControllerConfigGroup.defaultAccess = ["controller", "host", "control"];
|
|
ControllerConfigGroup.groupName = "player_auth";
|
|
ControllerConfigGroup.define({
|
|
name: "code_length",
|
|
title: "Code Length",
|
|
description: "Length in characters of the generated codes.",
|
|
type: "number",
|
|
initial_value: 6,
|
|
});
|
|
ControllerConfigGroup.define({
|
|
name: "code_timeout",
|
|
title: "Code Timeout",
|
|
description: "Time in seconds for the generated codes to stay valid.",
|
|
type: "number",
|
|
initial_value: 120,
|
|
});
|
|
ControllerConfigGroup.finalize();
|
|
|
|
module.exports = {
|
|
name: "player_auth",
|
|
title: "Player Auth",
|
|
description: "Provides authentication to the cluster via logging into a Factorio server.",
|
|
controllerEntrypoint: "controller",
|
|
instanceEntrypoint: "instance",
|
|
webEntrypoint: "./web",
|
|
ControllerConfigGroup,
|
|
|
|
messages: [
|
|
messages.FetchPlayerCodeRequest,
|
|
messages.SetVerifyCodeRequest,
|
|
],
|
|
};
|