Sha256: 819cd049b300582e523fc5d6a40a9c4167dc0d2be8d161c879224e6a46b995b0

Contents?: true

Size: 1.18 KB

Versions: 24

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

module Net
  class IMAP
    module SASL

      module ProtocolAdapters
        # This API is experimental, and may change.
        module Generic
          def command_name;     "AUTHENTICATE" end
          def service;          raise "Implement in subclass or module" end
          def host;             client.host end
          def port;             client.port end
          def encode_ir(string) string.empty? ? "=" : encode(string) end
          def encode(string)    [string].pack("m0") end
          def decode(string)    string.unpack1("m0") end
          def cancel_response;  "*" end
        end

        # See RFC-3501 (IMAP4rev1), RFC-4959 (SASL-IR capability),
        # and RFC-9051 (IMAP4rev2).
        module IMAP
          include Generic
          def service; "imap" end
        end

        # See RFC-4954 (AUTH capability).
        module SMTP
          include Generic
          def command_name; "AUTH" end
          def service; "smtp" end
        end

        # See RFC-5034 (SASL capability).
        module POP
          include Generic
          def command_name; "AUTH" end
          def service; "pop" end
        end

      end

    end
  end
end

Version data entries

24 entries across 24 versions & 5 rubygems

Version Path
net-imap-0.4.4 lib/net/imap/sasl/protocol_adapters.rb
net-imap-0.4.3 lib/net/imap/sasl/protocol_adapters.rb
net-imap-0.4.2 lib/net/imap/sasl/protocol_adapters.rb
net-imap-0.4.1 lib/net/imap/sasl/protocol_adapters.rb