mirror of
https://github.com/Telecominfraproject/wlan-ucentral-schema.git
synced 2026-01-27 02:23:33 +00:00
Provide Input Validation for Romaing Mobility Domain
Signed-off-by: Kishan Shukla <kishan.shukla@hfcl.com>
This commit is contained in:
committed by
John Crispin
parent
fda6ded45a
commit
a3ea74a914
@@ -74,6 +74,12 @@ let GeneratorProto = {
|
||||
'return match(value, /^[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]$/i);'
|
||||
]
|
||||
},
|
||||
"uc-mobility": {
|
||||
desc: 'Mobility Domain',
|
||||
code: [
|
||||
'return match(value, /^[0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i);'
|
||||
]
|
||||
},
|
||||
"uc-host": {
|
||||
desc: 'hostname or IP address',
|
||||
code: [
|
||||
|
||||
@@ -21,8 +21,7 @@ properties:
|
||||
description:
|
||||
Mobility Domain identifier (dot11FTMobilityDomainID, MDID).
|
||||
type: string
|
||||
maxLength: 4
|
||||
minLength: 4
|
||||
format: uc-mobility
|
||||
examples:
|
||||
- abcd
|
||||
pmk-r0-key-holder:
|
||||
|
||||
@@ -22,6 +22,10 @@ function matchUcMac(value) {
|
||||
return match(value, /^[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]$/i);
|
||||
}
|
||||
|
||||
function matchUcMobility(value) {
|
||||
return match(value, /^[0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i);
|
||||
}
|
||||
|
||||
function matchUcHost(value) {
|
||||
if (length(iptoarr(value)) != 0) return true;
|
||||
if (length(value) > 255) return false;
|
||||
@@ -2812,11 +2816,8 @@ function instantiateInterfaceSsidRoaming(location, value, errors) {
|
||||
|
||||
function parseDomainIdentifier(location, value, errors) {
|
||||
if (type(value) == "string") {
|
||||
if (length(value) > 4)
|
||||
push(errors, [ location, "must be at most 4 characters long" ]);
|
||||
|
||||
if (length(value) < 4)
|
||||
push(errors, [ location, "must be at least 4 characters long" ]);
|
||||
if (!matchUcMobility(value))
|
||||
push(errors, [ location, "must be a valid Mobility Domain" ]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1683,8 +1683,7 @@
|
||||
"domain-identifier": {
|
||||
"description": "Mobility Domain identifier (dot11FTMobilityDomainID, MDID).",
|
||||
"type": "string",
|
||||
"maxLength": 4,
|
||||
"minLength": 4,
|
||||
"format": "uc-mobility",
|
||||
"examples": [
|
||||
"abcd"
|
||||
]
|
||||
|
||||
@@ -1145,8 +1145,7 @@
|
||||
},
|
||||
"domain-identifier": {
|
||||
"type": "string",
|
||||
"maxLength": 4,
|
||||
"minLength": 4,
|
||||
"format": "uc-mobility",
|
||||
"examples": [
|
||||
"abcd"
|
||||
]
|
||||
|
||||
@@ -1293,8 +1293,7 @@
|
||||
"domain-identifier": {
|
||||
"description": "Mobility Domain identifier (dot11FTMobilityDomainID, MDID).",
|
||||
"type": "string",
|
||||
"maxLength": 4,
|
||||
"minLength": 4,
|
||||
"format": "uc-mobility",
|
||||
"examples": [
|
||||
"abcd"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user