mesg-foundation / engine

Build apps or autonomous workflows with reusable, shareable integrations connecting any service, app, blockchain or decentralized network.
https://mesg.com/
Apache License 2.0
130 stars 13 forks source link

Add more validation on the data #294

Closed antho1404 closed 5 years ago

antho1404 commented 6 years ago

With the issue https://github.com/mesg-foundation/core/issues/194 data from inputs, results and events are validated to match at least the data in the mesg.yml

We should make sure that we also don't send too much data but exactly the ones needed.

Example:

Let's have an event that have the data "foo" and "bar"

we actually need to send the payload with "foo" and "bar" but we can also add any other attribute "x", "y"... and this will be accepted by the core.

We can be strict on the validation and make sure to only have what the mesg.yml file defines otherwise it's an error.

This filter can be done directly in the different libraries like https://github.com/mesg-foundation/mesg-js

NicolasMahe commented 5 years ago

Is it behavior has been fixed?

antho1404 commented 5 years ago

Not yet, we are still allowing more data from the service without throwing any errors. This kind of fix will break services like the ethereum one that send all the payload of a block where the mesg api just expose few data from the block

NicolasMahe commented 5 years ago

Moved to https://forum.mesg.com/t/add-more-validation-on-the-data/152