Class: Mongo::Auth::X509
- Inherits:
-
Object
- Object
- Mongo::Auth::X509
- Defined in:
- lib/mongo/auth/x509.rb,
lib/mongo/auth/x509/conversation.rb
Overview
Defines behaviour for x.509 authentication.
Defined Under Namespace
Classes: Conversation
Constant Summary collapse
- MECHANISM =
The authentication mechinism string.
'MONGODB-X509'.freeze
Instance Attribute Summary collapse
-
#user ⇒ Mongo::Auth::User
readonly
The user to authenticate.
Instance Method Summary collapse
-
#initialize(user) ⇒ X509
constructor
Instantiate a new authenticator.
-
#login(connection) ⇒ Protocol::Reply
Log the user in on the given connection.
Constructor Details
#initialize(user) ⇒ X509
Instantiate a new authenticator.
41 42 43 |
# File 'lib/mongo/auth/x509.rb', line 41 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Mongo::Auth::User (readonly)
Returns The user to authenticate.
31 32 33 |
# File 'lib/mongo/auth/x509.rb', line 31 def user @user end |
Instance Method Details
#login(connection) ⇒ Protocol::Reply
Log the user in on the given connection.
56 57 58 59 |
# File 'lib/mongo/auth/x509.rb', line 56 def login(connection) conversation = Conversation.new(user) conversation.finalize(connection.dispatch([ conversation.start ])) end |