class Net::IMAP::SASL::ClientAdapter
SASL::ProtocolAdapters.
possible, ClientAdapter delegates the handling of these requirements to
lists requirements for protocol specifications to offer SASL. Where
=== Protocol Requirements
ProtocolAdapters::Generic isn’t sufficient.
Subclasses should also include a protocol adapter mixin when the default
semantics of this API to their API.
SASL::ClientAdapter and override methods as needed to match the
most methods simply delegate to #client. Clients should subclass
Represents the client to a SASL::AuthenticationExchange. By default,
TODO: use with more clients, to verify the API can accommodate them.
This API is experimental, and may change.
def authenticate(...) AuthenticationExchange.authenticate(self, ...) end
By default, this simply delegates to
Attempt to authenticate #client to the server.
def authenticate(...) AuthenticationExchange.authenticate(self, ...) end
def initialize(client, &command_proc)
Subclasses may override it, for example: to set the appropriate
By default, this simply sets the #client and #command_proc attributes.
def initialize(client, &command_proc) @client, @command_proc = client, command_proc end
def response_errors; [] end
Returns an array of server responses errors raised by run_command.
def response_errors; [] end
def run_command(mechanism, initial_response = nil, &continuations_handler)
command to fail.
*MUST* raise an exception. Exceptions in the block *MUST* cause the
result of each yield, and returns the result. Non-successful results
Yields each continuation payload, responds to the server with the
command_proc.
The +initial_response+ is optional; when it's nil, it won't be sent to
+mechanism+, +initial_response+, and a +continuations_handler+ block.
SASL::ProtocolAdapters::Generic#command_name),
Calls command_proc with +command_name+ (see
def run_command(mechanism, initial_response = nil, &continuations_handler) command_proc or raise Error, "initialize with block or override" args = [command_name, mechanism, initial_response].compact command_proc.call(*args, &continuations_handler) end