mongo-proxy icon indicating copy to clipboard operation
mongo-proxy copied to clipboard

allow for authentication

Open girishbin opened this issue 9 years ago • 1 comments

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

girishbin avatar Mar 24 '15 11:03 girishbin

Hey @girishbin, thanks for creating this issue. Would you be willing to create a pull req with this proposed change?

bakks avatar Apr 05 '15 03:04 bakks