Sha256: 265e9968a117bc03101bb185d1bff078573f68212ff8f26a2ff982947a3079af

Contents?: true

Size: 1.93 KB

Versions: 17

Compression:

Stored size: 1.93 KB

Contents

module Fluent
  module KafkaPluginUtil
    module SSLSettings
      def self.included(klass)
        klass.instance_eval {
          # https://github.com/zendesk/ruby-kafka#encryption-and-authentication-using-ssl
          config_param :ssl_ca_cert, :array, :value_type => :string, :default => nil,
                       :desc => "a PEM encoded CA cert to use with and SSL connection."
          config_param :ssl_client_cert, :string, :default => nil,
                       :desc => "a PEM encoded client cert to use with and SSL connection. Must be used in combination with ssl_client_cert_key."
          config_param :ssl_client_cert_key, :string, :default => nil,
                       :desc => "a PEM encoded client cert key to use with and SSL connection. Must be used in combination with ssl_client_cert."
        }
      end

      def read_ssl_file(path)
        return nil if path.nil?

        if path.is_a?(Array)
          path.map { |fp| File.read(fp) }
        else
          File.read(path)
        end
      end
    end

    module SaslSettings
      def self.included(klass)
        klass.instance_eval {
          config_param :principal, :string, :default => nil,
                       :desc => "a Kerberos principal to use with SASL authentication (GSSAPI)."
          config_param :keytab, :string, :default => nil,
                       :desc => "a filepath to Kerberos keytab. Must be used with principal."
          config_param :username, :string, :default => nil,
                       :desc => "a username when using PLAIN/SCRAM SASL authentication"
          config_param :password, :string, :default => nil,
                       :desc => "a password when using PLAIN/SCRAM SASL authentication"
          config_param :scram_mechanism, :string, :default => nil,
                       :desc => "if set, use SCRAM authentication with specified mechanism. When unset, default to PLAIN authentication"
        }
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
fluent-plugin-kafka-0.7.2 lib/fluent/plugin/kafka_plugin_util.rb
fluent-plugin-kafka-0.7.1 lib/fluent/plugin/kafka_plugin_util.rb
fluent-plugin-kafka-0.7.0 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.18 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.17 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.16 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.15 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.14 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.13 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.12 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.11 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.10 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.9 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.8 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.7 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.6 lib/fluent/plugin/kafka_plugin_util.rb
roched-fluent-plugin-kafka-0.6.5 lib/fluent/plugin/kafka_plugin_util.rb