Deleting a Sync Gateway's user from a bucket takes no effect

Hello !

I’m using Sync Gateway 1.4 and I found a strange situation: I have a sync_gateway config file with several buckets, each of them having some users.

Here is a minified sample of this configuration file:

{
        "admininterface": "0.0.0.0:4985",
        "log": ["*"],
        "logging": {
                "default": {
                        "logFilePath": "/var/log/sync_gateway/sglogfile.log",
                        "log": ["*"],
                        "logKeys": ["*"],
                        "logLevel": "debug",
                        "rotation": {
                                "maxsize": 1,
                                "maxage": 30,
                                "maxbackups": 10,
                                "localtime": true
                        }
                }
        },
        "databases": {
                "my-bucket": {
                        "server": "http://localhost:8091",
                        "bucket": "MY_BUCKET",
                        "cache": {
                                "channel_cache_max_length": 100000
                        },
                        "users": {
                                "USERA": {
                                        "admin_channels": ["*"],
                                        "password": "thepassword"
                                },
                                "USERB": {
                                        "admin_channels": ["*"],
                                        "password": "thepassword"
                                }
			}
               }
	}
}

If I log into my bucket through Couchbase Lite by authentifying as User A, the authentification is successful.

What is strange (and worrying) is that if I do the followings steps:

  1. Remove the USER A from the configuration file;
  2. Run service sync_gateway restart;
  3. Trying to log again with USER A

=> The authentification is still successfull.

Is their any kind of cache that could explain this? Is it the right way of deleting a bucket’s user?

Thank’s for reading !

You will have to use the DELETE user API for deleting the user via the REST API. You cannot remove a user by simply removing it from config file and restarting SGW - because SGW is stateless and will not be able to detect that a user was in fact removed.

Oh, well, in fact this makes sense.
Thanks a lot!