mongo-proxy
mongo-proxy copied to clipboard
allow for authentication
Allow for authentication in auth.rb , otherwise won't allow for read if auth is enabled on mongos.
Here is the error
raise OperationFailure(msg % errmsg, code) pymongo.errors.OperationFailure: command {'getnonce': 1} failed: Writes and Javascript execution are disallowed in this interface.
Added below lines in auth.rb , please check if its hold good.
elsif (query['getnonce'] || query['authenticate']) == 1 return true, nil
Diff :
git diff HEAD diff --git a/lib/mongo-proxy/auth.rb b/lib/mongo-proxy/auth.rb index cae2d40..7b2a439 100644 --- a/lib/mongo-proxy/auth.rb +++ b/lib/mongo-proxy/auth.rb @@ -117,6 +117,10 @@ class AuthMongo return true, nil end
-
## allow authentication
-
elsif (query['getnonce'] || query['authenticate']) == 1
-
return true, nil
-
allow ismaster query, listDatabases query
-
Hey @girishbin, thanks for creating this issue. Would you be willing to create a pull req with this proposed change?