Class Qpid::Proton::SASL
In: lib/core/sasl.rb
Parent: Object

The SASL layer is responsible for establishing an authenticated and/or encrypted tunnel over which AMQP frames are passed between peers.

The peer acting as the SASL client must provide authentication credentials.

The peer acting as the SASL server must provide authentication against the received credentials.

@example

  # SCENARIO: the remote endpoint has not initialized their connection
  #           then the local endpoint, acting as a SASL server, decides
  #           to allow an anonymous connection.
  #
  #           The SASL layer locally assumes the role of server and then
  #           enables anonymous authentication for the remote endpoint.
  #
  sasl = @transport.sasl
  sasl.server
  sasl.mechanisms("ANONYMOUS")
  sasl.done(Qpid::Proton::SASL::OK)

Methods

done   mechanisms   new   outcome  

Constants

NONE = Cproton::PN_SASL_NONE   Negotation has not completed.
OK = Cproton::PN_SASL_OK   Authentication succeeded.
AUTH = Cproton::PN_SASL_AUTH   Authentication failed due to bad credentials.

Public Class methods

Constructs a new instance for the given transport.

@param transport [Transport] The transport.

@private A SASL should be fetched only from its Transport

Public Instance methods

Set the condition of the SASL negotiation.

@param outcome [Fixnum] The outcome.

Sets the acceptable SASL mechanisms.

@param mechanisms [String] The space-delimited set of mechanisms.

@example Use anonymous SASL authentication.

 @sasl.mechanisms("GSSAPI CRAM-MD5 PLAIN")

Returns the outcome of the SASL negotiation.

@return [Fixnum] The outcome.

[Validate]