Open EvanTheB opened 6 years ago
Thanks @EvanTheB - we'll take a look at this
For the person (even if it's me) who picks this up -> I did a quick poke around and I think the reason for this is that our original validation in PartialWorkflowSources
appears to be getting run through a YAML parser and tabs aren't valid YAML, but are ok in JSON.
Another few thoughts to the person who picks this up -> this bug likely also exists on whatever initial validation is being done for CWL files as they can also be json but presumably are being run through a yaml parser
YAML claims to be a superset of JSON, but it is not (as this proves). Every time I have encountered YAML in a project it has been a headache, just my 2c. It is a strange syntax, with the potential for infinite recursion and bombs. It makes for a hard parser implementation, and there have been security and perfomance issues in the past. Fine for local configuration files, but probably not a good idea for any public facing APIs.
Indeed I just pushed a recursive yaml file to the same endpoint, and the server crashed:
yaml.json: {a: &b [*b]}
@EvanTheB The main issue here is that we need to support YAML for Cromwell's CWL support. It looks like when that went in there were a few spots where the proverbial pair of birds was killed with a single stone a bit overeagerly.
That's an interesting example however. Food for thought.
further reading: https://github.com/cblp/yaml-sucks/
I was running through the tutorial, https://cromwell.readthedocs.io/en/develop/tutorials/ServerMode/. I typed the inputs.json file with a tab instead of spaces.
curl -X POST http://localhost:8000/api/workflows/v1 -F workflowSource=@hello.wdl -F workflowInputs=@inputs.json
However per the JSON spec, tabs, or any whitespace, "can be inserted between any pair of tokens" https://www.json.org/.
Python:
Sadly I do not know Java very well or I would just check and or fix whichever parser you are using.
Thanks