class Mongo::Auth::X509
Defines behaviour 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::Reply ] The authentication response.
@since 2.0.0
# File lib/mongo/auth/x509.rb, line 56 def login(connection) conversation = Conversation.new(user) conversation.finalize(connection.dispatch([ conversation.start ])) end