123456789_123456789_123456789_123456789_123456789_

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.

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

#client_first_document (private)

Since:

  • 2.0.0

[ GitHub ]

  
# 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_documentHash | 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.

Returns:

  • (Hash | nil)

    Speculative authentication document.

Since:

  • 2.0.0

[ GitHub ]

  
# 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.

Parameters:

Returns:

Since:

  • 2.0.0

[ GitHub ]

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

def start(connection)
  validate_external_auth_source
  selector = client_first_document
  build_message(connection, '$external', selector)
end