Class: Kafka::Protocol::SaslHandshakeRequest
- Inherits:
-
Object
- Object
- Kafka::Protocol::SaslHandshakeRequest
- Defined in:
- lib/kafka/protocol/sasl_handshake_request.rb
Overview
SaslHandshake Request (Version: 0) => mechanism mechanism => string
Constant Summary collapse
- SUPPORTED_MECHANISMS =
%w(AWS_MSK_IAM GSSAPI PLAIN SCRAM-SHA-256 SCRAM-SHA-512 OAUTHBEARER)
Instance Method Summary collapse
- #api_key ⇒ Object
- #encode(encoder) ⇒ Object
-
#initialize(mechanism) ⇒ SaslHandshakeRequest
constructor
A new instance of SaslHandshakeRequest.
- #response_class ⇒ Object
Constructor Details
#initialize(mechanism) ⇒ SaslHandshakeRequest
Returns a new instance of SaslHandshakeRequest.
13 14 15 16 17 18 |
# File 'lib/kafka/protocol/sasl_handshake_request.rb', line 13 def initialize(mechanism) unless SUPPORTED_MECHANISMS.include?(mechanism) raise Kafka::Error, "Unsupported SASL mechanism #{mechanism}. Supported are #{SUPPORTED_MECHANISMS.join(', ')}" end @mechanism = mechanism end |
Instance Method Details
#api_key ⇒ Object
20 21 22 |
# File 'lib/kafka/protocol/sasl_handshake_request.rb', line 20 def api_key SASL_HANDSHAKE_API end |
#encode(encoder) ⇒ Object
28 29 30 |
# File 'lib/kafka/protocol/sasl_handshake_request.rb', line 28 def encode(encoder) encoder.write_string(@mechanism) end |
#response_class ⇒ Object
24 25 26 |
# File 'lib/kafka/protocol/sasl_handshake_request.rb', line 24 def response_class SaslHandshakeResponse end |