Fix definitions, to match other schema yml definitions

Signed-off-by: Mike Hansen <mike.hansen@netexperience.com>
This commit is contained in:
Mike Hansen
2023-07-17 19:45:04 -04:00
committed by John Crispin
parent f56f754c5f
commit 3f98df2d75
3 changed files with 125 additions and 125 deletions

View File

@@ -11,5 +11,5 @@ properties:
by the corresponding property name.
patternProperties:
".+":
$ref: "#/$defs/interface.ssid.encryption"
$ref: "https://ucentral.io/schema/v1/interface/ssid/encryption/"
additionalProperties: false

View File

@@ -369,6 +369,84 @@ function instantiateGlobals(location, value, errors) {
return value;
}
function instantiateInterfaceSsidEncryption(location, value, errors) {
if (type(value) == "object") {
let obj = {};
function parseProto(location, value, errors) {
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
if (!(value in [ "none", "owe", "owe-transition", "psk", "psk2", "psk-mixed", "psk2-radius", "wpa", "wpa2", "wpa-mixed", "sae", "sae-mixed", "wpa3", "wpa3-192", "wpa3-mixed" ]))
push(errors, [ location, "must be one of \"none\", \"owe\", \"owe-transition\", \"psk\", \"psk2\", \"psk-mixed\", \"psk2-radius\", \"wpa\", \"wpa2\", \"wpa-mixed\", \"sae\", \"sae-mixed\", \"wpa3\", \"wpa3-192\" or \"wpa3-mixed\"" ]);
return value;
}
if (exists(value, "proto")) {
obj.proto = parseProto(location + "/proto", value["proto"], errors);
}
function parseKey(location, value, errors) {
if (type(value) == "string") {
if (length(value) > 63)
push(errors, [ location, "must be at most 63 characters long" ]);
if (length(value) < 8)
push(errors, [ location, "must be at least 8 characters long" ]);
}
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
return value;
}
if (exists(value, "key")) {
obj.key = parseKey(location + "/key", value["key"], errors);
}
function parseIeee80211w(location, value, errors) {
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
if (!(value in [ "disabled", "optional", "required" ]))
push(errors, [ location, "must be one of \"disabled\", \"optional\" or \"required\"" ]);
return value;
}
if (exists(value, "ieee80211w")) {
obj.ieee80211w = parseIeee80211w(location + "/ieee80211w", value["ieee80211w"], errors);
}
else {
obj.ieee80211w = "disabled";
}
function parseKeyCaching(location, value, errors) {
if (type(value) != "bool")
push(errors, [ location, "must be of type boolean" ]);
return value;
}
if (exists(value, "key-caching")) {
obj.key_caching = parseKeyCaching(location + "/key-caching", value["key-caching"], errors);
}
else {
obj.key_caching = true;
}
return obj;
}
if (type(value) != "object")
push(errors, [ location, "must be of type object" ]);
return value;
}
function instantiateDefinitions(location, value, errors) {
if (type(value) == "object") {
let obj = {};
@@ -2335,84 +2413,6 @@ function instantiateInterfaceBroadBand(location, value, errors) {
return value;
}
function instantiateInterfaceSsidEncryption(location, value, errors) {
if (type(value) == "object") {
let obj = {};
function parseProto(location, value, errors) {
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
if (!(value in [ "none", "owe", "owe-transition", "psk", "psk2", "psk-mixed", "psk2-radius", "wpa", "wpa2", "wpa-mixed", "sae", "sae-mixed", "wpa3", "wpa3-192", "wpa3-mixed" ]))
push(errors, [ location, "must be one of \"none\", \"owe\", \"owe-transition\", \"psk\", \"psk2\", \"psk-mixed\", \"psk2-radius\", \"wpa\", \"wpa2\", \"wpa-mixed\", \"sae\", \"sae-mixed\", \"wpa3\", \"wpa3-192\" or \"wpa3-mixed\"" ]);
return value;
}
if (exists(value, "proto")) {
obj.proto = parseProto(location + "/proto", value["proto"], errors);
}
function parseKey(location, value, errors) {
if (type(value) == "string") {
if (length(value) > 63)
push(errors, [ location, "must be at most 63 characters long" ]);
if (length(value) < 8)
push(errors, [ location, "must be at least 8 characters long" ]);
}
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
return value;
}
if (exists(value, "key")) {
obj.key = parseKey(location + "/key", value["key"], errors);
}
function parseIeee80211w(location, value, errors) {
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
if (!(value in [ "disabled", "optional", "required" ]))
push(errors, [ location, "must be one of \"disabled\", \"optional\" or \"required\"" ]);
return value;
}
if (exists(value, "ieee80211w")) {
obj.ieee80211w = parseIeee80211w(location + "/ieee80211w", value["ieee80211w"], errors);
}
else {
obj.ieee80211w = "disabled";
}
function parseKeyCaching(location, value, errors) {
if (type(value) != "bool")
push(errors, [ location, "must be of type boolean" ]);
return value;
}
if (exists(value, "key-caching")) {
obj.key_caching = parseKeyCaching(location + "/key-caching", value["key-caching"], errors);
}
else {
obj.key_caching = true;
}
return obj;
}
if (type(value) != "object")
push(errors, [ location, "must be of type object" ]);
return value;
}
function instantiateInterfaceSsidMultiPsk(location, value, errors) {
if (type(value) == "object") {
let obj = {};

View File

@@ -191,6 +191,52 @@
}
}
},
"interface.ssid.encryption": {
"type": "object",
"properties": {
"proto": {
"type": "string",
"enum": [
"none",
"owe",
"owe-transition",
"psk",
"psk2",
"psk-mixed",
"psk2-radius",
"wpa",
"wpa2",
"wpa-mixed",
"sae",
"sae-mixed",
"wpa3",
"wpa3-192",
"wpa3-mixed"
],
"examples": [
"psk2"
]
},
"key": {
"type": "string",
"maxLength": 63,
"minLength": 8
},
"ieee80211w": {
"type": "string",
"enum": [
"disabled",
"optional",
"required"
],
"default": "disabled"
},
"key-caching": {
"type": "boolean",
"default": true
}
}
},
"definitions": {
"type": "object",
"properties": {
@@ -975,52 +1021,6 @@
}
]
},
"interface.ssid.encryption": {
"type": "object",
"properties": {
"proto": {
"type": "string",
"enum": [
"none",
"owe",
"owe-transition",
"psk",
"psk2",
"psk-mixed",
"psk2-radius",
"wpa",
"wpa2",
"wpa-mixed",
"sae",
"sae-mixed",
"wpa3",
"wpa3-192",
"wpa3-mixed"
],
"examples": [
"psk2"
]
},
"key": {
"type": "string",
"maxLength": 63,
"minLength": 8
},
"ieee80211w": {
"type": "string",
"enum": [
"disabled",
"optional",
"required"
],
"default": "disabled"
},
"key-caching": {
"type": "boolean",
"default": true
}
}
},
"interface.ssid.multi-psk": {
"type": "object",
"properties": {