fluent-plugin-syslog_rfc5424 0.2.1 → 0.3.0

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: 631caa1e479ab376df1e171eff8c3c9c0b2fbadd
4
- data.tar.gz: 78d51e228bb8dafa134a6a3196a8a9f44cc48dd7
3
+ metadata.gz: 2631f0a1816e3d1a620c304a5c59473c94bdfabd
4
+ data.tar.gz: 45f95366e08b4f3cefaab3d8ef2b160152ca6226
5
5
  SHA512:
6
- metadata.gz: 8807cf51fb9c7b5f7a48b4dfce3faa190fb656b5cca210f67cca3306f8c5054e12ac137607398c0e2b6300775cbee542dcd13947292c1214b1f4987b34e194a2
7
- data.tar.gz: 28d4801b6e7074f077b12e592258c77800f59edd2bfa7c8696886fe06d2f708dde5585d136c766ba4dd6e1da0a059a4bc122a32550b7e41818d3f54a461a5480
6
+ metadata.gz: 9b34cf26779b21721e19a04e5bb0223ab77614e675673baaf727bfee0219e92e8ad14c0dd4c7025fc34d2ce13eb3e2b73b7b2e34940408913c895e20e17de6b9
7
+ data.tar.gz: c50ff16d02a200b54f10bf7b6c490b16cdf36cf119a4d10661b1b9892a3c568f99bfc77f6e2e0fc3705a7b3f8af73bc9c1973158bd0f08ebe04363662a10d603
@@ -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.2.1"
7
+ spec.version = "0.3.0"
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"
@@ -11,6 +11,7 @@ module Fluent
11
11
  config_param :host, :string
12
12
  config_param :port, :integer
13
13
  config_param :transport, :string, default: "tls"
14
+ config_param :insecure, :bool, default: false
14
15
  config_section :format do
15
16
  config_set_default :@type, DEFAULT_FORMATTER
16
17
  config_set_default :rfc6587_message_size, true
@@ -42,7 +43,7 @@ module Fluent
42
43
  socket = find_socket(transport, host, port)
43
44
  return socket if socket
44
45
 
45
- @sockets[socket_key(transport, host, port)] = self.socket_create(transport.to_sym, host, port)
46
+ @sockets[socket_key(transport, host, port)] = self.socket_create(transport.to_sym, host, port, insecure: @insecure)
46
47
  end
47
48
 
48
49
  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).returns(socket)
38
+ mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false}).returns(socket)
39
39
  end
40
40
 
41
41
  output_driver.run do
@@ -56,7 +56,29 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
56
56
  stub(socket).close
57
57
 
58
58
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
59
- mock(fluent_plugin).socket_create(:tcp, "example.com", 123).returns(socket)
59
+ mock(fluent_plugin).socket_create(:tcp, "example.com", 123, {:insecure=>false}).returns(socket)
60
+ end
61
+
62
+ output_driver.run do
63
+ output_driver.feed("tag", @time, {"log" => "hi"})
64
+ end
65
+ end
66
+
67
+ def test_insecure_tls
68
+ output_driver = create_driver %(
69
+ @type syslog_rfc5424
70
+ host example.com
71
+ port 123
72
+ transport tcp
73
+ insecure true
74
+ )
75
+
76
+ socket = Minitest::Mock.new
77
+ mock(socket).puts(@formatted_log)
78
+ stub(socket).close
79
+
80
+ any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
81
+ mock(fluent_plugin).socket_create(:tcp, "example.com", 123, {:insecure=>true}).returns(socket)
60
82
  end
61
83
 
62
84
  output_driver.run do
@@ -75,7 +97,7 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
75
97
  stub(socket).puts(@formatted_log)
76
98
 
77
99
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
78
- mock(fluent_plugin).socket_create(:tls, "example.com", 123).returns(socket)
100
+ mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false}).returns(socket)
79
101
  end
80
102
 
81
103
  mock(socket).close
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-syslog_rfc5424
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-26 00:00:00.000000000 Z
11
+ date: 2020-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler