123456789_123456789_123456789_123456789_123456789_

Class: Mongo::Auth::LDAP::Conversation Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Mongo::Auth::ConversationBase
Defined in: lib/mongo/auth/ldap/conversation.rb

Overview

Defines behavior around a single PLAIN conversation between the client and server.

Since:

  • 2.0.0

Constant Summary

Class Method Summary

::Mongo::Auth::ConversationBase - Inherited

.new

Create the new conversation.

Instance Attribute Summary

Instance Method Summary

::Mongo::Auth::ConversationBase - Inherited

#build_message,
#speculative_auth_document

Returns the hash to provide to the server in the handshake as value of the speculativeAuthenticate key.

#validate_external_auth_source

Instance Method Details

#payload (private)

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/auth/ldap/conversation.rb', line 51

def payload
  BSON::Binary.new("\x00#{user.name}\x00#{user.password}")
end

#start(connection) ⇒ Protocol::Query

Start the PLAIN conversation. This returns the first message that needs to be sent to the server.

Parameters:

Returns:

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/auth/ldap/conversation.rb', line 43

def start(connection)
  validate_external_auth_source
  selector = LOGIN.merge(payload: payload, mechanism: LDAP::MECHANISM)
  build_message(connection, '$external', selector)
end