ForkbombEu / signroom

Document and data signing platform
GNU Affero General Public License v3.0
5 stars 0 forks source link

Custom code and data checks #689

Open matteo-cristino opened 2 weeks ago

matteo-cristino commented 2 weeks ago

For easier deployment of the microservices ensure that custom data set in the template from the user is a valid JSON, at the moment also broken JSON are accepted like

image

matteo-cristino commented 2 weeks ago

Moreover the zencode can also be checked with

import { zencode_valid_code } from "zenroom";
try {
  zencode_valid_code(custom_code_string)
} catch(err) {
  // -> show err.logs to the user <-
}

err.logs should be a stringified json, but there are corner cases that are not still covered in zenroom thus pay attention. Maybe try to parse it, if error then show the original logs. If you can add this event to the logs it will be amazing so that we can fix it in zenroom