Class: Mongo::Auth::Base Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo/auth/base.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Base class for authenticators.

Each authenticator is instantiated for authentication over a particular connection.

Since:

  • 2.0.0

API:

  • private

Direct Known Subclasses

Aws, CR, Gssapi, LDAP, Scram, X509

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, connection, **opts) ⇒ Base

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes the authenticator.

Parameters:

  • The user to authenticate.

  • The connection to authenticate over.

Since:

  • 2.0.0

API:

  • private



40
41
42
43
# File 'lib/mongo/auth/base.rb', line 40

def initialize(user, connection, **opts)
  @user = user
  @connection = connection
end

Instance Attribute Details

#connectionMongo::Connection (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The connection to authenticate over.

Returns:

  • The connection to authenticate over.

Since:

  • 2.0.0

API:

  • private



33
34
35
# File 'lib/mongo/auth/base.rb', line 33

def connection
  @connection
end

#userMongo::Auth::User (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The user to authenticate.

Returns:

  • The user to authenticate.

Since:

  • 2.0.0

API:

  • private



30
31
32
# File 'lib/mongo/auth/base.rb', line 30

def user
  @user
end

Instance Method Details

#conversationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0

API:

  • private



45
46
47
# File 'lib/mongo/auth/base.rb', line 45

def conversation
  @conversation ||= self.class.const_get(:Conversation).new(user, connection)
end