Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-1664

Validate javascript syntax in DbConfig.validate()

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.0
    • None
    • SyncGateway
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jacques.rascagneres Jacques Rascagneres
            ben.brooks Ben Brooks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty