fluent-plugin-syslog_rfc5424 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d18ce4a652bcc4290cc9dacb98e7b6d8c05d7d8d
4
- data.tar.gz: 9f8bcbc47850d81ebaee276d454efb2efb889972
3
+ metadata.gz: ee4be79798fa377cdaa6f46eac5164605a6e776f
4
+ data.tar.gz: c2bcd1dbd5ad4a831aa0e5f41dbd7817fd2e9620
5
5
  SHA512:
6
- metadata.gz: 8368f0f1c15eb5f06733f0741d1014e9f30f875fd9abad9891d9c8012095346c76727c1a0514ef759f0c8ac9c6a41895d67d16888e872ca15086c418ab08f338
7
- data.tar.gz: a2fbeccef2c610298a71368e2fe646db1c2d54394fb666f1d0f57c452455618be6bd2013ae1e62039a705683f59ed4f74ddc67eb7db5c89a8240a08af297b0d7
6
+ metadata.gz: d49f27b105429bbb813a503f67cbdba4ef88b3a9767d26f5a072905f53f5639ed235b28bbc3e6971535675ede46cbad0275da8ef933ea0db9af5938f9f91ea03
7
+ data.tar.gz: ef36eedddc6089415d4b5704e2ec7df02498923268571dfbc1ee833bb2f7c8fe958e9b1518b13d75e540ddca624eabb0c83861143a4168c25ec925b61c072106
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-syslog_rfc5424"
7
- spec.version = "0.4.0"
7
+ spec.version = "0.5.1"
8
8
  spec.authors = ["Pivotal"]
9
9
  spec.email = %w(cf-loggregator@pivotal.io)
10
10
  spec.homepage = "https://github.com/cloudfoundry/fluent-plugin-syslog_rfc5424"
@@ -12,6 +12,7 @@ module Fluent
12
12
  config_param :port, :integer
13
13
  config_param :transport, :string, default: "tls"
14
14
  config_param :insecure, :bool, default: false
15
+ config_param :trusted_ca_path, :string, default: nil
15
16
  config_section :format do
16
17
  config_set_default :@type, DEFAULT_FORMATTER
17
18
  config_set_default :rfc6587_message_size, true
@@ -49,7 +50,7 @@ module Fluent
49
50
  def socket_options
50
51
  return {} unless @transport == 'tls'
51
52
 
52
- { insecure: @insecure, verify_fqdn: !@insecure }
53
+ { insecure: @insecure, verify_fqdn: !@insecure, cert_paths: @trusted_ca_path }
53
54
  end
54
55
 
55
56
  def socket_key(transport, host, port)
@@ -35,7 +35,7 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
35
35
  stub(socket).close
36
36
 
37
37
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
38
- mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true}).returns(socket)
38
+ mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>nil}).returns(socket)
39
39
  end
40
40
 
41
41
  output_driver.run do
@@ -78,7 +78,29 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
78
78
  stub(socket).close
79
79
 
80
80
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
81
- mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>true, :verify_fqdn=>false}).returns(socket)
81
+ mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>true, :verify_fqdn=>false, :cert_paths=>nil}).returns(socket)
82
+ end
83
+
84
+ output_driver.run do
85
+ output_driver.feed("tag", @time, {"log" => "hi"})
86
+ end
87
+ end
88
+
89
+ def test_secure_tls
90
+ output_driver = create_driver %(
91
+ @type syslog_rfc5424
92
+ host example.com
93
+ port 123
94
+ transport tls
95
+ trusted_ca_path supertrustworthy
96
+ )
97
+
98
+ socket = Minitest::Mock.new
99
+ mock(socket).puts(@formatted_log)
100
+ stub(socket).close
101
+
102
+ any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
103
+ mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>"supertrustworthy"}).returns(socket)
82
104
  end
83
105
 
84
106
  output_driver.run do
@@ -97,7 +119,7 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
97
119
  stub(socket).puts(@formatted_log)
98
120
 
99
121
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
100
- mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true}).returns(socket)
122
+ mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>nil}).returns(socket)
101
123
  end
102
124
 
103
125
  mock(socket).close
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-syslog_rfc5424
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal