Replace URL Parameters on POST requests with body
Applies to TaskDefinitionController and TaskExecutionController. Motivated by https://stackoverflow.com/questions/71020365/spring-cloud-data-flow-task-properties. Best practice would be to use config server for this, but for a single task, it is overkill. These properties can be in the Task definition, but they are passed as URL Parameters currently, so not encrypted over https.
Propose to add post body method where applicable and have dataflow clients upgrade to that. Deprecate the current versions, and then discontinue in the next major release.
Proposed Plan
- Add new APIs that receive task properties via POST body rather than request params.
- Deprecate the existing request-param based APIs
- Modify front end to use new apis
Users that are using the REST API directly can continue using the existing (deprecated) API w/ the recommendation to move to the new API.
ℹ️ Moving to POST body would also solve encoding issues like #4782
It is possible to POST using: Content-Type: application/x-www-form-urlencoded
curl "https://my-scdf-server/tasks/definitions" -i -X POST -d @data.txt -H "Content-Type: application/x-www-form-urlencoded"
data.txt:
name=my-test-task&definition=app1+--prop1%3Dtest1+%26%26+app2+--prop2%3Dtest2&description=My+test+task+for+testing
A nicer way would be to post it as JSON ... that would also be nicer for the schedule endpoint, where certain config deployer properties are defined for Kubernetes/Cloud Foundry. Of course you need to put application specific properties using Config Server, but these deployer properties are platform specific and they can quite grow in numbers when you have a large task. Using the above, that would result in a large encoded line in your text file.