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

Validate javascript syntax in DbConfig.validate()

    XMLWordPrintable

Details

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

          ben.brooks Ben Brooks created issue -
          ben.brooks Ben Brooks made changes -
          Field Original Value New Value
          Link This issue relates to CBG-1662 [ CBG-1662 ]
          ben.brooks Ben Brooks made changes -
          Link This issue relates to CBG-1661 [ CBG-1661 ]
          ben.brooks Ben Brooks made changes -
          Link This issue relates to CBG-1619 [ CBG-1619 ]
          jacques.rascagneres Jacques Rascagneres made changes -
          Assignee The One [ the one ] Jacques Rascagneres [ jacques.rascagneres ]
          jacques.rascagneres Jacques Rascagneres made changes -
          Sprint CBG Sprint 81 [ 1759 ]
          jacques.rascagneres Jacques Rascagneres made changes -
          Story Points 3
          jacques.rascagneres Jacques Rascagneres made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          jacques.rascagneres Jacques Rascagneres made changes -
          Status In Progress [ 3 ] In Review [ 10107 ]
          adamf Adam Fraser made changes -
          Sprint CBG Sprint 81 [ 1759 ] CBG Sprint 81, CBG Sprint 82 [ 1759, 1777 ]
          Automated transition triggered when Adam Fraser merged pull request #5217 in GitHub -
          Resolution Fixed [ 1 ]
          Status In Review [ 10107 ] Resolved [ 5 ]
          adamf Adam Fraser made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          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