Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
Security Level: Public
-
None
-
CBG Sprint 81, CBG Sprint 82
-
3
Description
Javascript functions given in database config or the new javascript endpoints (sync and import_filter) should be syntactically valid, and today are only checked upon load. It would be ideal to validate them before the config is persisted.
We can ensure the functions are valid javascript inside DbConfig.validate() by running them through sgbucket.NewJSRunner(src) and ensuring no error is returned, which should prevent invalid javascript from being set on a config before being persisted.