module Net::SASL

Pluggable authentication mechanisms for protocols which support SASL (Simple Authentication and Security Layer), such as IMAP4, SMTP, LDAP, and XMPP. SASL is described by RFC4422: “SASL is conceptually a framework that provides an abstraction layer between protocols and mechanisms as illustrated in the following diagram.”

    SMTP    LDAP    XMPP   Other protocols ...
       \       |    |      /
        \      |    |     /
       SASL abstraction layer
        /      |    |     \
       /       |    |      \
EXTERNAL   GSSAPI  PLAIN   Other mechanisms ...

This library was originally implemented for Net::IMAP, and has been extracted from there.

Constants

DEFAULT_REGISTRY

The default global registry used by Net::SASL.authenticator

VERSION

Public Class Methods

add_authenticator(mechanism, authenticator) click to toggle source

Adds an authenticator to the global registry, for use with Net::SASL.authenticator. See Net::SASL::Registry#add_authenticator.

# File lib/net/sasl.rb, line 46
def self.add_authenticator(mechanism, authenticator)
  DEFAULT_REGISTRY.add_authenticator(mechanism, authenticator)
end
authenticator(mechanism, *args, **kwargs) click to toggle source

Builds an authenticator in its initial state, based on mechanism name. Any additional arguments will be passed directly to the chosen authenticator's #new method. See Net::SASL::Registry#authenticator.

# File lib/net/sasl.rb, line 53
def self.authenticator(mechanism, *args, **kwargs)
  DEFAULT_REGISTRY.authenticator(mechanism, *args, **kwargs)
end