From 5b040d132f4b1327fe6a3b01108ec097f202ce94 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Tue, 19 Sep 2023 21:52:26 -0700 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-12945 Signed-off-by: stephb9959 --- build | 2 +- src/framework/ConfigurationValidator.cpp | 233 ++++++++++++++++++----- 2 files changed, 187 insertions(+), 48 deletions(-) diff --git a/build b/build index d99e90eb..8580e7b6 100644 --- a/build +++ b/build @@ -1 +1 @@ -29 \ No newline at end of file +30 \ No newline at end of file diff --git a/src/framework/ConfigurationValidator.cpp b/src/framework/ConfigurationValidator.cpp index 00de09b4..28b6e0ca 100644 --- a/src/framework/ConfigurationValidator.cpp +++ b/src/framework/ConfigurationValidator.cpp @@ -28,11 +28,16 @@ static const std::string GitUCentralJSONSchemaFile{ "ucentral.schema.json"}; static std::string DefaultUCentralSchema = R"foo( + { "$id": "https://openwrt.org/ucentral.schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { + "strict": { + "type": "boolean", + "default": false + }, "uuid": { "type": "integer" }, @@ -113,6 +118,20 @@ static std::string DefaultUCentralSchema = R"foo( "random-password": { "type": "boolean", "default": false + }, + "beacon-advertisement": { + "type": "object", + "properties": { + "device-name": { + "type": "boolean" + }, + "device-serial": { + "type": "boolean" + }, + "network-id": { + "type": "integer" + } + } } } }, @@ -221,6 +240,52 @@ static std::string DefaultUCentralSchema = R"foo( } } }, + "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": { @@ -715,7 +780,8 @@ static std::string DefaultUCentralSchema = R"foo( "type": "string", "enum": [ "dynamic", - "static" + "static", + "none" ], "examples": [ "static" @@ -1005,52 +1071,6 @@ static std::string DefaultUCentralSchema = R"foo( } ] }, - "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": { @@ -2019,6 +2039,11 @@ static std::string DefaultUCentralSchema = R"foo( "decription": "This option allows embedding custom vendor specific IEs inside the beacons of a BSS in AP mode.", "type": "string" }, + "tip-information-element": { + "decription": "The device will broadcast the TIP vendor IE inside its beacons if this option is enabled.", + "type": "boolean", + "default": true + }, "fils-discovery-interval": { "type": "integer", "default": 20, @@ -2442,6 +2467,24 @@ static std::string DefaultUCentralSchema = R"foo( "type": "boolean", "default": false }, + "mode": { + "type": "string", + "enum": [ + "radius", + "user" + ] + }, + "port-filter": { + "type": "array", + "items": { + "type": "string", + "examples": [ + { + "LAN1": null + } + ] + } + }, "server-certificate": { "type": "string" }, @@ -2453,6 +2496,77 @@ static std::string DefaultUCentralSchema = R"foo( "items": { "$ref": "#/$defs/interface.ssid.radius.local-user" } + }, + "radius": { + "type": "object", + "properties": { + "nas-identifier": { + "type": "string" + }, + "auth-server-addr": { + "type": "string", + "format": "uc-host", + "examples": [ + "192.168.1.10" + ] + }, + "auth-server-port": { + "type": "integer", + "maximum": 65535, + "minimum": 1024, + "examples": [ + 1812 + ] + }, + "auth-server-secret": { + "type": "string", + "examples": [ + "secret" + ] + }, + "acct-server-addr": { + "type": "string", + "format": "uc-host", + "examples": [ + "192.168.1.10" + ] + }, + "acct-server-port": { + "type": "integer", + "maximum": 65535, + "minimum": 1024, + "examples": [ + 1813 + ] + }, + "acct-server-secret": { + "type": "string", + "examples": [ + "secret" + ] + }, + "coa-server-addr": { + "type": "string", + "format": "uc-host", + "examples": [ + "192.168.1.10" + ] + }, + "coa-server-port": { + "type": "integer", + "maximum": 65535, + "minimum": 1024, + "examples": [ + 1814 + ] + }, + "coa-server-secret": { + "type": "string", + "examples": [ + "secret" + ] + } + } } } }, @@ -2776,6 +2890,12 @@ static std::string DefaultUCentralSchema = R"foo( } } }, + "services": { + "type": "array", + "items": { + "type": "string" + } + }, "classifier": { "type": "array", "items": { @@ -3018,6 +3138,24 @@ static std::string DefaultUCentralSchema = R"foo( "relay-server": { "type": "string", "format": "uc-ip" + }, + "circuit-id-format": { + "type": "string", + "enum": [ + "vlan-id", + "ap-mac", + "ssid" + ], + "default": "vlan-id" + }, + "remote-id-format": { + "type": "string", + "enum": [ + "vlan-id", + "ap-mac", + "ssid" + ], + "default": "ap-mac" } } } @@ -3325,6 +3463,7 @@ static std::string DefaultUCentralSchema = R"foo( } } } + )foo"; static inline bool IsIPv4(const std::string &value) {