Module: Mongo::Auth
- Extended by:
- Auth
- Included in:
- Auth
- Defined in:
- lib/mongo/auth.rb,
lib/mongo/auth/cr.rb,
lib/mongo/auth/ldap.rb,
lib/mongo/auth/user.rb,
lib/mongo/auth/x509.rb,
lib/mongo/auth/roles.rb,
lib/mongo/auth/scram.rb,
lib/mongo/auth/user/view.rb,
lib/mongo/auth/cr/conversation.rb,
lib/mongo/auth/ldap/conversation.rb,
lib/mongo/auth/x509/conversation.rb,
lib/mongo/auth/scram/conversation.rb
Overview
This namespace contains all authentication related behaviour.
Defined Under Namespace
Modules: Roles Classes: CR, InvalidMechanism, LDAP, SCRAM, Unauthorized, User, X509
Constant Summary collapse
- EXTERNAL =
The external database name.
'$external'.freeze
- GET_NONCE =
Constant for the nonce command.
{ getnonce: 1 }.freeze
- NONCE =
Constant for the nonce field.
'nonce'.freeze
- SOURCES =
Map the symbols parsed from the URI connection string to strategies.
{ mongodb_cr: CR, mongodb_x509: X509, plain: LDAP, scram: SCRAM }
Instance Method Summary collapse
-
#get(user) ⇒ CR, ...
Get the authorization strategy for the provided auth mechanism.
Instance Method Details
#get(user) ⇒ CR, ...
Get the authorization strategy for the provided auth mechanism.
65 66 67 68 69 |
# File 'lib/mongo/auth.rb', line 65 def get(user) mechanism = user.mechanism raise InvalidMechanism.new(mechanism) if !SOURCES.has_key?(mechanism) SOURCES[mechanism].new(user) end |