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.ts94
1 files changed, 46 insertions, 48 deletions
diff --git a/src/server/Session/session_config_schema.ts b/src/server/Session/session_config_schema.ts
index 0acb304db..72b8d388a 100644
--- a/src/server/Session/session_config_schema.ts
+++ b/src/server/Session/session_config_schema.ts
@@ -1,58 +1,56 @@
import { Schema } from "jsonschema";
const emailPattern = /^(([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+)?$/g;
-const localPortPattern = /\/[a-zA-Z]*/g;
+const routePattern = /\/[a-zA-Z]*/g;
-const properties: { [name: string]: Schema } = {
- ports: {
- type: "object",
- properties: {
- server: { type: "number" },
- socket: { type: "number" }
+export const configurationSchema: Schema = {
+ id: "/configuration",
+ type: "object",
+ properties: {
+ ports: {
+ type: "object",
+ properties: {
+ server: { type: "number", minimum: 1024, maximum: 65535 },
+ socket: { type: "number", minimum: 1024, maximum: 65535 }
+ },
+ required: ["server"],
+ additionalProperties: true
},
- required: ["server"],
- additionalProperties: true
- },
- heartbeatRoute: {
- type: "string",
- pattern: localPortPattern
- },
- email: {
- type: "object",
- properties: {
- recipients: {
- type: "array",
- items: {
- type: "string",
- pattern: emailPattern
+ pollingRoute: {
+ type: "string",
+ pattern: routePattern
+ },
+ email: {
+ type: "object",
+ properties: {
+ recipients: {
+ type: "array",
+ items: {
+ type: "string",
+ pattern: emailPattern
+ },
+ minLength: 1
},
- minLength: 1
+ signature: {
+ type: "string",
+ minLength: 1
+ }
},
- signature: {
- type: "string",
- minLength: 1
- }
+ required: ["recipients"]
},
- required: ["recipients"]
- },
- masterIdentifier: {
- type: "string",
- minLength: 1
- },
- workerIdentifier: {
- type: "string",
- minLength: 1
- },
- showServerOutput: { type: "boolean" },
- pollingIntervalSeconds: {
- type: "number",
- minimum: 1,
- maximum: 86400
+ 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,
}; \ No newline at end of file