Class: Mongo::Auth::Base Private

Inherits:
Object
  • Object
show all
Defined in:
build/ruby-driver-v2.19/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

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:

  • user (Auth::User)

    The user to authenticate.

  • connection (Mongo::Connection)

    The connection to authenticate over.

Since:

  • 2.0.0



40
41
42
43
# File 'build/ruby-driver-v2.19/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:

  • (Mongo::Connection)

    The connection to authenticate over.

Since:

  • 2.0.0



33
34
35
# File 'build/ruby-driver-v2.19/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:

Since:

  • 2.0.0



30
31
32
# File 'build/ruby-driver-v2.19/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



45
46
47
# File 'build/ruby-driver-v2.19/lib/mongo/auth/base.rb', line 45

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