Class: Mongo::Auth::X509::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/x509/conversation.rb |
Overview
Defines behavior around a single X.509 conversation between the client and server.
Constant Summary
-
LOGIN =
The login message.
{ authenticate: 1, mechanism: X509::MECHANISM }.freeze
Class Method Summary
::Mongo::Auth::ConversationBase
- Inherited
.new | Create the new conversation. |
Instance Attribute Summary
::Mongo::Auth::ConversationBase
- Inherited
Instance Method Summary
-
#speculative_auth_document ⇒ Hash | nil
Internal use only
Returns the hash to provide to the server in the handshake as value of the speculativeAuthenticate key.
-
#start(connection) ⇒ Protocol::Message
Internal use only
Start the X.509 conversation.
- #client_first_document private Internal use only
::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
#client_first_document (private)
# File 'lib/mongo/auth/x509/conversation.rb', line 62
def client_first_document LOGIN.dup.tap do |payload| payload[:user] = user.name if user.name end end
#speculative_auth_document ⇒ Hash
| nil
Returns the hash to provide to the server in the handshake as value of the speculativeAuthenticate key.
If the auth mechanism does not support speculative authentication, this method returns nil.
# File 'lib/mongo/auth/x509/conversation.rb', line 56
def speculative_auth_document client_first_document end
#start(connection) ⇒ Protocol::Message
Start the X.509 conversation. This returns the first message that needs to be sent to the server.
# File 'lib/mongo/auth/x509/conversation.rb', line 43
def start(connection) validate_external_auth_source selector = client_first_document (connection, '$external', selector) end