Module: Mongo::Auth::StringPrep
- Extended by:
- StringPrep
- Included in:
- StringPrep
- Defined in:
- lib/mongo/auth/stringprep.rb,
lib/mongo/auth/stringprep/tables.rb,
lib/mongo/auth/stringprep/profiles/sasl.rb
Overview
This namespace contains all behavior related to string preparation (RFC 3454). It’s used to implement SCRAM-SHA-256 authentication, which is available in MongoDB server versions 4.0 and up.
Defined Under Namespace
Instance Method Summary collapse
-
#prepare(data, mappings, prohibited, options = {}) ⇒ Object
Prepare a string given a set of mappings and prohibited character tables.
Instance Method Details
#prepare(data, mappings, prohibited, options = {}) ⇒ Object
Prepare a string given a set of mappings and prohibited character tables.
50 51 52 53 54 55 56 |
# File 'lib/mongo/auth/stringprep.rb', line 50 def prepare(data, mappings, prohibited, = {}) apply_maps(data, mappings).tap do |mapped| normalize!(mapped) if [:normalize] check_prohibited!(mapped, prohibited) check_bidi!(mapped) if [:bidi] end end |