Skip to content

Commit

Permalink
Removed connection profile URL validation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jonesywolf authored and lorenzodonini committed Oct 22, 2023
1 parent 288ad8d commit 85c930b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion ocpp2.0.1/provisioning/set_network_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion ocpp2.0.1_test/set_network_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 85c930b

Please sign in to comment.