Class: Impala::SASLTransport
- Inherits:
-
Thrift::FramedTransport
- Object
- Thrift::FramedTransport
- Impala::SASLTransport
- Defined in:
- lib/impala/sasl_transport.rb
Constant Summary collapse
- STATUS_BYTES =
1
- PAYLOAD_LENGTH_BYTES =
4
- NEGOTIATION_STATUS =
{ START: 0x01, OK: 0x02, BAD: 0x03, ERROR: 0x04, COMPLETE: 0x05 }
Instance Method Summary collapse
-
#initialize(transport, mechanism, options = {}) ⇒ SASLTransport
constructor
A new instance of SASLTransport.
- #open ⇒ Object
Constructor Details
#initialize(transport, mechanism, options = {}) ⇒ SASLTransport
Returns a new instance of SASLTransport.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/impala/sasl_transport.rb', line 15 def initialize(transport, mechanism, ={}) super(transport) @mechanism = mechanism.to_sym @options = unless [:PLAIN, :GSSAPI].include? @mechanism raise "Unknown SASL mechanism: #{@mechanism}" end if @mechanism == :GSSAPI @gsscli = GSSAPI::Simple.new(@options[:host], @options[:principal]) end end |
Instance Method Details
#open ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/impala/sasl_transport.rb', line 29 def open super case @mechanism when :PLAIN handshake_plain! when :GSSAPI handshake_gssapi! end end |