A newer version of this documentation is available.

View Latest

Access Control Configuration

      +
      Pre-3.0 Legacy Configuration Equivalents

      This content describes configuration for Sync Gateway 3.0 and higher — for legacy configuration, see: Legacy Pre-3.0 Configuration

      Upsert Sync Function

      The sync function is crucial to the security of your application. It is in charge of data validation, access control and routing. The function executes every time a new revision/update is made to a document.

      https:://{sgw-uri}/{db}/_config/sync
      https:://{sgw-uri}/{keyspace}/_config/sync

      This will allow you to update the sync function.

      Required Sync Gateway RBAC roles:

      • Sync Gateway Architect

      For more on the Sync Function and access control see: Sync Function Overview

      Parameters

      Path Parameters

      Name Description Schema

      keyspace
      required

      The keyspace to run the operation against.

      A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.

      String

      Body Parameter

      Name Description Schema

      Body
      optional

      The new sync function to use

      ifeval::["function (doc, oldDoc) {
      channel(doc.channels);
      }" != "null"]
      Example: function (doc, oldDoc) {
      channel(doc.channels);
      }

      String

      Header Parameters

      Name Description Schema

      If-Match
      optional

      If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.

      String

      Query Parameters

      Name Description Schema

      disable_oidc_validation
      optional

      If set, will not attempt to validate the configured OpenID Connect providers are reachable.

      Default: false

      Boolean

      Responses

      HTTP Code Description Schema

      200

      Updated sync function successfully

      400

      There was a problem with your request

      HTTP_Error

      404

      Resource could not be found

      HTTP_Error

      412

      Precondition Failed The supplied If-Match header did not match the current version of the configuration. Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update.

      HTTP_Error