Class: EM::Mongo::Authentication

Inherits:
Object
  • Object
show all
Includes:
Deferrable
Defined in:
lib/em-mongo/auth/Authentication.rb

Direct Known Subclasses

MONGODB_CR, SCRAM

Defined Under Namespace

Modules: AuthMethod

Constant Summary collapse

SYSTEM_COMMAND_COLLECTION =
'$cmd'

Instance Method Summary collapse

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.

Parameters:

Returns:

Raises:



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