Conversation — Documentation by YARD 0.9.37 (original) (raw)

Class: Mongo::Auth::CR::ConversationDeprecated Private

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.

Deprecated.

MONGODB-CR authentication mechanism is deprecated as of MongoDB 3.6. Support for it in the Ruby driver will be removed in driver version 3.0. Please use SCRAM instead.

Defines behavior around a single MONGODB-CR conversation between the client and server.

Constant Summarycollapse

LOGIN =

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

The login message base.

{ authenticate: 1 }.freeze

Instance Attribute Summary collapse

Attributes inherited from Mongo::Auth::ConversationBase

#connection, #user

Instance Method Summarycollapse

Methods inherited from Mongo::Auth::ConversationBase

#build_message, #initialize, #speculative_auth_document, #validate_external_auth_source

Instance Attribute Details

#database ⇒ String

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 database The database to authenticate against.

38 39 40 # File 'lib/mongo/auth/cr/conversation.rb', line 38 def database @database end

#nonce ⇒ String

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 nonce The initial auth nonce.

41 42 43 # File 'lib/mongo/auth/cr/conversation.rb', line 41 def nonce @nonce end

Instance Method Details

#continue(reply_document, connection) ⇒ Protocol::Message

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.

Continue the CR conversation. This sends the client final message to the server after setting the reply from the previous server communication.

69 70 71 72 73 # File 'lib/mongo/auth/cr/conversation.rb', line 69 def continue(reply_document, connection) @nonce = reply_document[Auth::NONCE] selector = LOGIN.merge(user: user.name, nonce: nonce, key: user.auth_key(nonce)) build_message(connection, user.auth_source, selector) end

#start(connection) ⇒ Protocol::Message

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.

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

52 53 54 55 # File 'lib/mongo/auth/cr/conversation.rb', line 52 def start(connection) selector = Auth::GET_NONCE build_message(connection, user.auth_source, selector) end