Fixed
Details
Assignee
Benjamin ReedBenjamin ReedReporter
Alejandro GalueAlejandro GalueLabels
Components
Sprint
NoneFix versions
Affects versions
Priority
Major
Details
Details
Assignee
Benjamin Reed
Benjamin ReedReporter
Alejandro Galue
Alejandro GalueLabels
Components
Sprint
None
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty
PagerDuty
Created October 31, 2017 at 8:50 PM
Updated November 7, 2017 at 3:07 PM
Resolved November 7, 2017 at 3:07 PM
Let's say an operator is managing the inventory through the ReST API directly as he is in the process of developing a script to populate the requisitions in OpenNMS.
The following XML is actually a valid content when querying
/opennms/rest/nodes
,It is good for that end point, as that is a partial representation of the
OnmsNode
object. Now, a user might try to use this wrong object against/opennms/rest/requisitions
, which is not going to work as that is not a representation of aRequisitionedNode
object.The problem is that the API won't complain and will accept the request:
The above assumes that I've saved the XML on a file called
bad-node.xml
.Now, if I try to perform a GET request against the requisitions end point for the requisition in question, it fails and returs an HTTP 500 error.
Checking the logs, I found the problem on the attached
web.log
.From now on, the ReST end point for the affected requisition is unusable until opennms is restarted.
I think the ReST end point should validate the XML input and reject it when it is malformed, which is not the case, hence the exception: