Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
Ghost
-
5
-
ghost-27.01.2021, ghost-10.02.2021, ghost-24.02.2021, ghost-10.03.2021
-
Known Issue
-
Description
Right now, this will succeed, returning all facts, and it shouldn't:
curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'
|
In the example above there isn't an enclosing set of brackets so there are two ast forms submitted but only the first ["from", "facts"] is evaluated.
Another example:
curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] this-is-trailing-garbage-and-not-part-of-the-query-that-gets-evaluated' |
We should error when this happens and indicate in that there was more than one form submitted in the query. It may be possible to do this by adding another func in middleware.clj to the handler that's created in the build-app func.