Sha256: 7a04d783d6c42d0911c61d3e45bcec3dbbbb958b0928f669bc014fb4039ff25f

Contents?: true

Size: 746 Bytes

Versions: 8

Compression:

Stored size: 746 Bytes

Contents

# encoding: utf-8

module AMQ::Client::Async

  # 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

8 entries across 8 versions & 1 rubygems

Version Path
amq-client-1.0.4 lib/amq/client/async/auth_mechanism_adapter/plain.rb
amq-client-1.0.3 lib/amq/client/async/auth_mechanism_adapter/plain.rb
amq-client-1.1.0.pre1 lib/amq/client/async/auth_mechanism_adapter/plain.rb
amq-client-1.0.2 lib/amq/client/async/auth_mechanism_adapter/plain.rb
amq-client-1.0.1 lib/amq/client/async/auth_mechanism_adapter/plain.rb
amq-client-1.0.0 lib/amq/client/async/auth_mechanism_adapter/plain.rb
amq-client-0.9.12 lib/amq/client/async/auth_mechanism_adapter/plain.rb
amq-client-0.9.11 lib/amq/client/async/auth_mechanism_adapter/plain.rb