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/stringprep.rb,
lib/mongo/auth/cr/conversation.rb,
lib/mongo/auth/credential_cache.rb,
lib/mongo/auth/ldap/conversation.rb,
lib/mongo/auth/stringprep/tables.rb,
lib/mongo/auth/x509/conversation.rb,
lib/mongo/auth/scram/conversation.rb,
lib/mongo/auth/stringprep/profiles/sasl.rb
Overview
This namespace contains all authentication related behavior.
Defined Under Namespace
Modules: CredentialCache, Roles, StringPrep Classes: CR, InvalidConfiguration, 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, scram256: 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.
68 69 70 71 72 |
# File 'lib/mongo/auth.rb', line 68 def get(user) mechanism = user.mechanism raise InvalidMechanism.new(mechanism) if !SOURCES.has_key?(mechanism) SOURCES[mechanism].new(user) end |