Class: EM::Mongo::Authentication
- Inherits:
-
Object
- Object
- EM::Mongo::Authentication
- Includes:
- Deferrable
- Defined in:
- lib/em-mongo/auth/Authentication.rb
Direct Known Subclasses
Defined Under Namespace
Modules: AuthMethod
Constant Summary collapse
- SYSTEM_COMMAND_COLLECTION =
'$cmd'
Instance Method Summary collapse
-
#authenticate(username, password) ⇒ EM::Mongo::RequestResponse
Authenticate with the given username and password.
-
#initialize(database) ⇒ Authentication
constructor
A new instance of Authentication.
Constructor Details
#initialize(database) ⇒ Authentication
Returns a new instance of Authentication.
16 17 18 |
# File 'lib/em-mongo/auth/Authentication.rb', line 16 def initialize(database) @db = database end |
Instance Method Details
#authenticate(username, password) ⇒ EM::Mongo::RequestResponse
Authenticate with the given username and password. Note that mongod must be started with the –auth option for authentication to be enabled.
31 32 33 34 35 |
# File 'lib/em-mongo/auth/Authentication.rb', line 31 def authenticate(username, password) r=DefaultDeferrable.new #stub implementation r.fail "not implemented, use a subclass instead" return r end |