Sha256: 9c8ad233f6c7642870921ac70b56b9c385b946d3bf99f037d86032c76ce2fb86

Contents?: true

Size: 732 Bytes

Versions: 24

Compression:

Stored size: 732 Bytes

Contents

# encoding: utf-8

module AMQP

  # Manages the encoding of credentials for the PLAIN authentication
  # mechanism.
  class AuthMechanismAdapter::Plain < AuthMechanismAdapter

    auth_mechanism "PLAIN"

    # Encodes credentials for the given username and password. This
    # involves sending the password across the wire in plaintext, so
    # PLAIN authentication should only be used over a secure transport
    # layer.
    #
    # @param [String] username The username to encode.
    # @param [String] password The password to encode.
    # @return [String] The username and password, encoded for the PLAIN
    #   mechanism.
    def encode_credentials(username, password)
      "\0#{username}\0#{password}"
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
amqp-1.1.1 lib/amqp/auth_mechanism_adapter/plain.rb
amqp-1.1.0 lib/amqp/auth_mechanism_adapter/plain.rb
amqp-1.1.0.rc1 lib/amqp/auth_mechanism_adapter/plain.rb
amqp-1.1.0.pre2 lib/amqp/auth_mechanism_adapter/plain.rb