class Mongo::Auth::X509
Defines behavior for x.509 authentication.
@since 2.0.0
Constants
- MECHANISM
The authentication mechinism string.
@since 2.0.0
Attributes
user[R]
@return [ Mongo::Auth::User
] The user to authenticate.
Public Class Methods
new(user)
click to toggle source
Instantiate a new authenticator.
@example Create the authenticator.
Mongo::Auth::X509.new(user)
@param [ Mongo::Auth::User
] user The user to authenticate.
@since 2.0.0
# File lib/mongo/auth/x509.rb, line 41 def initialize(user) @user = user end
Public Instance Methods
login(connection)
click to toggle source
Log the user in on the given connection.
@example Log the user in.
user.login(connection)
@param [ Mongo::Connection ] connection The connection to log into.
on.
@return [ Protocol::Message
] The authentication response.
@since 2.0.0
# File lib/mongo/auth/x509.rb, line 56 def login(connection) conversation = Conversation.new(user) reply = connection.dispatch([ conversation.start(connection) ]) connection.update_cluster_time(Operation::Result.new(reply)) conversation.finalize(reply) end