From 85c930b1a567fef7042c250125632b4b0493b432 Mon Sep 17 00:00:00 2001 From: John Wolf <4johnryanwolf@gmail.com> Date: Wed, 18 Oct 2023 10:14:14 -0400 Subject: [PATCH] Removed connection profile URL validation When executing charging station test case TC_B_43_CS detailed in part 6 of the standard, the charging station is supplied with an invalid URL and should respond with a rejected request not an error. --- ocpp2.0.1/provisioning/set_network_profile.go | 2 +- ocpp2.0.1_test/set_network_profile_test.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ocpp2.0.1/provisioning/set_network_profile.go b/ocpp2.0.1/provisioning/set_network_profile.go index 7f1cda16..867d7bf1 100644 --- a/ocpp2.0.1/provisioning/set_network_profile.go +++ b/ocpp2.0.1/provisioning/set_network_profile.go @@ -151,7 +151,7 @@ type APN struct { type NetworkConnectionProfile struct { OCPPVersion OCPPVersion `json:"ocppVersion" validate:"required,ocppVersion"` // The OCPP version used for this communication function. OCPPTransport OCPPTransport `json:"ocppTransport" validate:"required,ocppTransport"` // Defines the transport protocol (only OCPP-J is supported by this library). - CSMSUrl string `json:"ocppCsmsUrl" validate:"required,max=512,url"` // URL of the CSMS(s) that this Charging Station communicates with. + CSMSUrl string `json:"ocppCsmsUrl" validate:"required,max=512"` // URL of the CSMS(s) that this Charging Station communicates with. MessageTimeout int `json:"messageTimeout" validate:"gte=-1"` // Duration in seconds before a message send by the Charging Station via this network connection times out. SecurityProfile int `json:"securityProfile"` // The security profile used when connecting to the CSMS with this NetworkConnectionProfile. OCPPInterface OCPPInterface `json:"ocppInterface" validate:"required,ocppInterface"` // Applicable Network Interface. diff --git a/ocpp2.0.1_test/set_network_profile_test.go b/ocpp2.0.1_test/set_network_profile_test.go index 6e61e9c2..9e34cf66 100644 --- a/ocpp2.0.1_test/set_network_profile_test.go +++ b/ocpp2.0.1_test/set_network_profile_test.go @@ -71,7 +71,6 @@ func (suite *OcppV2TestSuite) TestSetNetworkProfileRequestValidation() { {provisioning.SetNetworkProfileRequest{ConfigurationSlot: -1, ConnectionData: provisioning.NetworkConnectionProfile{OCPPVersion: provisioning.OCPPVersion20, OCPPTransport: provisioning.OCPPTransportJSON, CSMSUrl: "http://someUrl:8767", MessageTimeout: 30, SecurityProfile: 1, OCPPInterface: provisioning.OCPPInterfaceWired0, VPN: vpn, APN: apn}}, false}, {provisioning.SetNetworkProfileRequest{ConfigurationSlot: 2, ConnectionData: provisioning.NetworkConnectionProfile{OCPPVersion: "OCPP01", OCPPTransport: provisioning.OCPPTransportJSON, CSMSUrl: "http://someUrl:8767", MessageTimeout: 30, SecurityProfile: 1, OCPPInterface: provisioning.OCPPInterfaceWired0, VPN: vpn, APN: apn}}, false}, {provisioning.SetNetworkProfileRequest{ConfigurationSlot: 2, ConnectionData: provisioning.NetworkConnectionProfile{OCPPVersion: provisioning.OCPPVersion20, OCPPTransport: "ProtoBuf", CSMSUrl: "http://someUrl:8767", MessageTimeout: 30, SecurityProfile: 1, OCPPInterface: provisioning.OCPPInterfaceWired0, VPN: vpn, APN: apn}}, false}, - {provisioning.SetNetworkProfileRequest{ConfigurationSlot: 2, ConnectionData: provisioning.NetworkConnectionProfile{OCPPVersion: provisioning.OCPPVersion20, OCPPTransport: provisioning.OCPPTransportJSON, CSMSUrl: "http://invalidUrl{}", MessageTimeout: 30, SecurityProfile: 1, OCPPInterface: provisioning.OCPPInterfaceWired0, VPN: vpn, APN: apn}}, false}, {provisioning.SetNetworkProfileRequest{ConfigurationSlot: 2, ConnectionData: provisioning.NetworkConnectionProfile{OCPPVersion: provisioning.OCPPVersion20, OCPPTransport: provisioning.OCPPTransportJSON, CSMSUrl: ">512.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", MessageTimeout: 30, SecurityProfile: 1, OCPPInterface: provisioning.OCPPInterfaceWired0, VPN: vpn, APN: apn}}, false}, {provisioning.SetNetworkProfileRequest{ConfigurationSlot: 2, ConnectionData: provisioning.NetworkConnectionProfile{OCPPVersion: provisioning.OCPPVersion20, OCPPTransport: provisioning.OCPPTransportJSON, CSMSUrl: "http://someUrl:8767", MessageTimeout: -2, SecurityProfile: 1, OCPPInterface: provisioning.OCPPInterfaceWired0, VPN: vpn, APN: apn}}, false}, {provisioning.SetNetworkProfileRequest{ConfigurationSlot: 2, ConnectionData: provisioning.NetworkConnectionProfile{OCPPVersion: provisioning.OCPPVersion20, OCPPTransport: provisioning.OCPPTransportJSON, CSMSUrl: "http://someUrl:8767", MessageTimeout: 30, SecurityProfile: 1, OCPPInterface: "invalidInterface", VPN: vpn, APN: apn}}, false},