Class: Qpid::Proton::SASL
- Inherits:
-
Object
- Object
- Qpid::Proton::SASL
- Defined in:
- lib/core/sasl.rb
Overview
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.
Constant Summary collapse
- NONE =
Negotation has not completed.
Cproton::PN_SASL_NONE
- OK =
Authentication succeeded.
Cproton::PN_SASL_OK
- AUTH =
Authentication failed due to bad credentials.
Cproton::PN_SASL_AUTH
Instance Method Summary collapse
-
#done(outcome) ⇒ Object
Set the condition of the SASL negotiation.
-
#initialize(transport) ⇒ SASL
constructor
Constructs a new instance for the given transport.
-
#mechanisms(mechanisms) ⇒ Object
Sets the acceptable SASL mechanisms.
-
#outcome ⇒ Fixnum
Returns the outcome of the SASL negotiation.
Constructor Details
#initialize(transport) ⇒ SASL
Constructs a new instance for the given transport.
59 60 61 |
# File 'lib/core/sasl.rb', line 59 def initialize(transport) @impl = Cproton.pn_sasl(transport.impl) end |
Instance Method Details
#done(outcome) ⇒ Object
Set the condition of the SASL negotiation.
88 89 90 |
# File 'lib/core/sasl.rb', line 88 def done(outcome) Cproton.pn_sasl_done(@impl, outcome) end |
#mechanisms(mechanisms) ⇒ Object
Sets the acceptable SASL mechanisms.
70 71 72 |
# File 'lib/core/sasl.rb', line 70 def mechanisms(mechanisms) Cproton.pn_sasl_mechanisms(@impl, mechanisms) end |
#outcome ⇒ Fixnum
Returns the outcome of the SASL negotiation.
78 79 80 81 82 |
# File 'lib/core/sasl.rb', line 78 def outcome outcome = Cprotn.pn_sasl_outcome(@impl) return nil if outcome == NONE outcome end |