Class: Mongo::Auth::CR::Conversation Deprecated Private
- Inherits:
-
Mongo::Auth::ConversationBase
- Object
- Mongo::Auth::ConversationBase
- Mongo::Auth::CR::Conversation
- Defined in:
- build/ruby-driver-v2.19/lib/mongo/auth/cr/conversation.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.
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 Summary collapse
- 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
-
#database ⇒ String
readonly
private
Database The database to authenticate against.
-
#nonce ⇒ String
readonly
private
Nonce The initial auth nonce.
Attributes inherited from Mongo::Auth::ConversationBase
Instance Method Summary collapse
-
#continue(reply_document, connection) ⇒ Protocol::Message
private
Continue the CR conversation.
-
#start(connection) ⇒ Protocol::Message
private
Start the CR conversation.
Methods inherited from Mongo::Auth::ConversationBase
#build_message, #initialize, #speculative_auth_document, #validate_external_auth_source
Constructor Details
This class inherits a constructor from Mongo::Auth::ConversationBase
Instance Attribute Details
#database ⇒ String (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 database The database to authenticate against.
38 39 40 |
# File 'build/ruby-driver-v2.19/lib/mongo/auth/cr/conversation.rb', line 38 def database @database end |
#nonce ⇒ String (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 nonce The initial auth nonce.
41 42 43 |
# File 'build/ruby-driver-v2.19/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 'build/ruby-driver-v2.19/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)) (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 'build/ruby-driver-v2.19/lib/mongo/auth/cr/conversation.rb', line 52 def start(connection) selector = Auth::GET_NONCE (connection, user.auth_source, selector) end |