aboutsummaryrefslogtreecommitdiff
path: root/src/server/Session/session_config_schema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Session/session_config_schema.ts')
-rw-r--r--src/server/Session/session_config_schema.ts44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/server/Session/session_config_schema.ts b/src/server/Session/session_config_schema.ts
index 25d95c243..a5010055a 100644
--- a/src/server/Session/session_config_schema.ts
+++ b/src/server/Session/session_config_schema.ts
@@ -1,25 +1,31 @@
import { Schema } from "jsonschema";
-export const configurationSchema: Schema = {
- id: "/Configuration",
- type: "object",
- properties: {
- recipients: {
- type: "array",
- items: {
- type: "string",
- pattern: /[^\@]+\@[^\@]+/g
- },
- minLength: 1
- },
- heartbeat: {
+const emailPattern = /^(([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+)?$/g;
+const localPortPattern = /http\:\/\/localhost:\d+\/[a-zA-Z]+/g;
+
+const properties = {
+ recipients: {
+ type: "array",
+ items: {
type: "string",
- pattern: /http\:\/\/localhost:\d+\/[a-zA-Z]+/g
+ pattern: emailPattern
},
- signature: { type: "string" },
- masterIdentifier: { type: "string", minLength: 1 },
- workerIdentifier: { type: "string", minLength: 1 },
- silentChildren: { type: "boolean" }
+ minLength: 1
},
- required: ["heartbeat", "recipients", "signature", "masterIdentifier", "workerIdentifier", "silentChildren"]
+ heartbeat: {
+ type: "string",
+ pattern: localPortPattern
+ },
+ signature: { type: "string" },
+ masterIdentifier: { type: "string", minLength: 1 },
+ workerIdentifier: { type: "string", minLength: 1 },
+ showServerOutput: { type: "boolean" },
+ pollingIntervalSeconds: { type: "number", minimum: 1, maximum: 86400 }
+};
+
+export const configurationSchema: Schema = {
+ id: "/configuration",
+ type: "object",
+ properties,
+ required: Object.keys(properties)
}; \ No newline at end of file