Couchbase Sync Gateway: Utilizing x.509 client authentication

Hi,

we currently have the following setup in our project:
We use PouchDB to sync with a sync gateway that is connected to a couchbase server. This works really well and we would like to move on with authentication now.

  1. Does the sync gateway provide in any way mutual authentication via x.509 certificates like the couchbase server does?
    We haven’t found any way to do this so we ended up putting an nginx reverse proxy in front of the sync gateway that handles the authentication for us.

  2. Is there any way to parse the request header in the Sync Gateway ? We would like to route documents to different buckets according to some http headers set in the requests. All we were able to find were the document-hooks that can be provided during Sync Gateway Configuration. But those get only passed the documents beeing edited not any other information.

Thanks a lot in advance for answering my questions. couchbase is an awesome product that really helped us so far!

All the best
Kai