Module Mongo::Auth::StringPrep
In: lib/mongo/auth/stringprep/tables.rb
lib/mongo/auth/stringprep/profiles/sasl.rb
lib/mongo/auth/stringprep.rb

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.

@since 2.6.0

Methods

prepare  

Classes and Modules

Module Mongo::Auth::StringPrep::Profiles
Module Mongo::Auth::StringPrep::Tables

Public Instance methods

Prepare a string given a set of mappings and prohibited character tables.

@example Prepare a string.

  StringPrep.prepare("some string",
                     StringPrep::Profiles::SASL::MAPPINGS,
                     StringPrep::Profiles::SASL::PROHIBITED,
                     normalize: true, bidi: true)

@param [ String ] data The string to prepare. @param [ Array ] mappings A list of mappings to apply to the data. @param [ Array ] prohibited A list of prohibited character lists to ensure the data doesn‘t

  contain after mapping and normalizing the data.

@param [ Hash ] options Optional operations to perform during string preparation.

@option options [ Boolean ] :normalize Whether or not to apply Unicode normalization to the

  data.

@option options [ Boolean ] :bidi Whether or not to ensure that the data contains valid

  bidirectional input.

@raise [ Error::FailedStringPrepValidation ] If stringprep validations fails.

@since 2.6.0

[Validate]