Module: Net::IMAP::SASL::ProtocolAdapters::Generic

Included in:
ClientAdapter, IMAP, POP, SMTP
Defined in:
lib/net/imap/sasl/protocol_adapters.rb

Overview

See SASL::ProtocolAdapters@Interface.

Instance Method Summary collapse

Instance Method Details

#cancel_responseObject

Returns the message used by the client to abort an authentication exchange.

The generic implementation returns "*".



73
# File 'lib/net/imap/sasl/protocol_adapters.rb', line 73

def cancel_response;  "*" end

#command_nameObject

The name of the protocol command used to initiate a SASL authentication exchange.

The generic implementation returns "AUTHENTICATE".



44
# File 'lib/net/imap/sasl/protocol_adapters.rb', line 44

def command_name;     "AUTHENTICATE" end

#decode(string) ⇒ Object

Decodes a server challenge string.

The generic implementation returns the Base64 decoding of string.



67
# File 'lib/net/imap/sasl/protocol_adapters.rb', line 67

def decode(string)    string.unpack1("m0") end

#encode(string) ⇒ Object

Encodes a client response string.

The generic implementation returns the Base64 encoding of string.



62
# File 'lib/net/imap/sasl/protocol_adapters.rb', line 62

def encode(string)    [string].pack("m0") end

#encode_ir(string) ⇒ Object

Encodes an initial response string.

The generic implementation returns the result of #encode, or returns "=" when string is empty.



57
# File 'lib/net/imap/sasl/protocol_adapters.rb', line 57

def encode_ir(string) string.empty? ? "=" : encode(string) end

#serviceObject

A service name from the GSSAPI/Kerberos/SASL Service Names registry.

The generic implementation returns "host", which is the generic GSSAPI host-based service name.



51
# File 'lib/net/imap/sasl/protocol_adapters.rb', line 51

def service;          "host" end