Class: Mongo::Auth::Gssapi::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::SaslConversationBase
|
| Defined in: | lib/mongo/auth/gssapi/conversation.rb |
Overview
Defines behaviour around a single Kerberos conversation between the client and the server.
Constant Summary
-
CONTINUE_MESSAGE =
# File 'lib/mongo/auth/gssapi/conversation.rb', line 32
The base client continue message.
{ saslContinue: 1 }.freeze -
START_MESSAGE =
# File 'lib/mongo/auth/gssapi/conversation.rb', line 29
The base client first message.
{ saslStart: 1, autoAuthorize: 1 }.freeze
::Mongo::Auth::SaslConversationBase - Inherited
Class Method Summary
-
.new(user, connection, **opts) ⇒ Conversation
constructor
Internal use only
Create the new conversation.
::Mongo::Auth::ConversationBase - Inherited
| .new | Create the new conversation. |
Instance Attribute Summary
- #authenticator ⇒ Authenticator readonly Internal use only
-
#id ⇒ Integer
readonly
Internal use only
Get the id of the conversation.
::Mongo::Auth::ConversationBase - Inherited
Instance Method Summary
- #client_first_document Internal use only
-
#continue(reply_document, connection) ⇒ Protocol::Message
Internal use only
Continue the conversation.
- #finalize(connection) ⇒ Protocol::Message Internal use only
- #process_continue_response(reply_document) Internal use only
::Mongo::Auth::SaslConversationBase - Inherited
| #start | Start the SASL conversation. |
| #auth_mechanism_name | Gets the auth mechanism name for the conversation class. |
| #client_first_document, #client_first_message_options, | |
| #validate_server_nonce! | Helper method to validate that server nonce starts with the client nonce. |
::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 Attribute Details
#authenticator ⇒ Authenticator (readonly)
# File 'lib/mongo/auth/gssapi/conversation.rb', line 59
attr_reader :authenticator
#id ⇒ Integer (readonly)
Get the id of the conversation.
# File 'lib/mongo/auth/gssapi/conversation.rb', line 64
attr_reader :id
Instance Method Details
#client_first_document
# File 'lib/mongo/auth/gssapi/conversation.rb', line 66
def client_first_document start_token = authenticator.initialize_challenge START_MESSAGE.merge(mechanism: Gssapi::MECHANISM, payload: start_token) end
#continue(reply_document, connection) ⇒ Protocol::Message
Continue the conversation.
# File 'lib/mongo/auth/gssapi/conversation.rb', line 77
def continue(reply_document, connection) @id = reply_document['conversationId'] payload = reply_document['payload'] continue_token = authenticator.evaluate_challenge(payload) selector = CONTINUE_MESSAGE.merge(payload: continue_token, conversationId: id) (connection, '$external', selector) end
#finalize(connection) ⇒ Protocol::Message
# File 'lib/mongo/auth/gssapi/conversation.rb', line 93
def finalize(connection) selector = CONTINUE_MESSAGE.merge(payload: @continue_token, conversationId: id) (connection, '$external', selector) end
#process_continue_response(reply_document)
# File 'lib/mongo/auth/gssapi/conversation.rb', line 86
def process_continue_response(reply_document) payload = reply_document['payload'] @continue_token = authenticator.evaluate_challenge(payload) end