123456789_123456789_123456789_123456789_123456789_

Class: Mongo::Auth::X509 Private

Relationships & Source Files
Namespace Children
Classes:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base
Instance Chain:
self, Base
Inherits: Mongo::Auth::Base
Defined in: lib/mongo/auth/x509.rb,
lib/mongo/auth/x509/conversation.rb

Overview

Defines behavior for X.509 authentication.

Since:

  • 2.0.0

Constant Summary

Class Method Summary

Base - Inherited

.new

Initializes the authenticator.

Instance Attribute Summary

Base - Inherited

Instance Method Summary

Base - Inherited

#conversation,
#converse_1_step

Performs a single-step conversation on the given connection.

#converse_2_step

Performs a two-step conversation on the given connection.

#converse_multi_step

Performs the variable-length SASL conversation on the given connection.

#dispatch_msg,
#validate_reply!

Checks whether reply is successful (i.e.

Constructor Details

.new(user, connection, **opts) ⇒ X509

Initializes the X.509 authenticator.

Parameters:

  • user (Auth::User)

    The user to authenticate.

  • connection (Mongo::Connection)

    The connection to authenticate over.

Since:

  • 2.0.0

[ GitHub ]

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

def initialize(user, connection, **opts)
  # The only valid database for X.509 authentication is $external.
  if user.auth_source != '$external'
    user_name_msg = if user.name
                      " #{user.name}"
                    else
                      ''
                    end
    raise Auth::InvalidConfiguration,
          "User#{user_name_msg} specifies auth source '#{user.auth_source}', but the only valid auth source for X.509 is '$external'"
  end

  super
end

Instance Method Details

#loginBSON::Document

Log the user in on the current connection.

Returns:

  • (BSON::Document)

    The document of the authentication response.

Since:

  • 2.0.0

[ GitHub ]

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

def 
  converse_1_step(connection, conversation)
end