diff --git a/frontend/src/pages/Subscribers/components/SubscriberModal.js b/frontend/src/pages/Subscribers/components/SubscriberModal.js index 44af569e165d04013014954208ee10570edc2a73..3cd065ff3c9d00d6073049b5f7d7e3b250b74c03 100644 --- a/frontend/src/pages/Subscribers/components/SubscriberModal.js +++ b/frontend/src/pages/Subscribers/components/SubscriberModal.js @@ -6,6 +6,57 @@ import _ from 'lodash'; let snssaiToString = (snssai) => snssai.sst.toString(16).padStart(2, '0').toUpperCase() + snssai.sd +function dnnConfigurationFromSliceConfiguration(dnnConfig){ + if (dnnConfig.upSecurityChk === true) { + return { + "sscModes": { + "defaultSscMode": "SSC_MODE_1", + "allowedSscModes": ["SSC_MODE_2", "SSC_MODE_3"] + }, + "pduSessionTypes": { + "defaultSessionType": "IPV4", + "allowedSessionTypes": ["IPV4"] + }, + "sessionAmbr": { + "uplink": dnnConfig.uplinkAmbr, + "downlink": dnnConfig.downlinkAmbr + }, + "5gQosProfile": { + "5qi": dnnConfig["5qi"], + "arp": { + "priorityLevel": 8 + }, + "priorityLevel": 8 + }, + "upSecurity": { + "upIntegr": dnnConfig.upIntegrity, + "upConfid": dnnConfig.upConfidentiality + } + } + } + return { + "sscModes": { + "defaultSscMode": "SSC_MODE_1", + "allowedSscModes": ["SSC_MODE_2", "SSC_MODE_3"] + }, + "pduSessionTypes": { + "defaultSessionType": "IPV4", + "allowedSessionTypes": ["IPV4"] + }, + "sessionAmbr": { + "uplink": dnnConfig.uplinkAmbr, + "downlink": dnnConfig.downlinkAmbr + }, + "5gQosProfile": { + "5qi": dnnConfig["5qi"], + "arp": { + "priorityLevel": 8 + }, + "priorityLevel": 8 + } + } +} + function smDatasFromSliceConfiguration(sliceConfiguration) { return _.map(sliceConfiguration, slice => { return { @@ -17,27 +68,7 @@ function smDatasFromSliceConfiguration(sliceConfiguration) { // key dnnConfig.dnn, // value - { - "sscModes": { - "defaultSscMode": "SSC_MODE_1", - "allowedSscModes": ["SSC_MODE_2", "SSC_MODE_3"] - }, - "pduSessionTypes": { - "defaultSessionType": "IPV4", - "allowedSessionTypes": ["IPV4"] - }, - "sessionAmbr": { - "uplink": dnnConfig.uplinkAmbr, - "downlink": dnnConfig.downlinkAmbr - }, - "5gQosProfile": { - "5qi": dnnConfig["5qi"], - "arp": { - "priorityLevel": 8 - }, - "priorityLevel": 8 - } - } + dnnConfigurationFromSliceConfiguration(dnnConfig) ])) } }) @@ -103,6 +134,18 @@ function sliceConfigurationsFromSubscriber(subscriber) { } }) } + if (dnnConfigs[dnn].upSecurity !== null){ + return { + dnn: dnn, + uplinkAmbr: dnnConfigs[dnn].sessionAmbr.uplink, + downlinkAmbr: dnnConfigs[dnn].sessionAmbr.downlink, + "5qi": dnnConfigs[dnn]["5gQosProfile"]["5qi"], + flowRules: flowRules, + upSecurityChk: true, + upIntegrity: dnnConfigs[dnn].upSecurity.upIntegr, + upConfidentiality: dnnConfigs[dnn].upSecurity.upConfid + }; + } return { dnn: dnn, uplinkAmbr: dnnConfigs[dnn].sessionAmbr.uplink, @@ -297,12 +340,51 @@ class SubscriberModal extends Component { minimum: 0, maximum: 255, title: "Default 5QI" - }, + }, flowRules: { type: "array", items: { $ref: "#/definitions/FlowInformation" }, maxItems: 1, title: "Flow Rules" + }, + upSecurityChk: { + "type": "boolean", + title: "UP Security", + "default": false + }, + }, + "dependencies": { + upSecurityChk: { + "oneOf": [ + { + "properties": { + upSecurityChk: { + "enum": [false] + } + }, + }, + { + "properties": { + upSecurityChk: { + "enum": [true] + }, + upIntegrity: { + type: "string", + title: "Integrity of UP Security", + enum: ["NOT_NEEDED", "PREFERRED", "REQUIRED"], + }, + upConfidentiality: { + type: "string", + title: "Confidentiality of UP Security", + enum: ["NOT_NEEDED", "PREFERRED", "REQUIRED"], + }, + }, + "required": [ + "upIntegrity", + "upConfidentiality" + ] + } + ] } }, },