logstash-mixin-http_client 2.1.0 → 2.2.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: 3410c3bea0f912007ff5ca1c641ae110720ca381
4
- data.tar.gz: 61ac66897e399787cf7cf15d74119e39a6ba9be7
3
+ metadata.gz: dc84bd2e6f07407dea886030c9e2aafe670f25e3
4
+ data.tar.gz: c5cdbb9d5973842be8222e3b718db1965d907e71
5
5
  SHA512:
6
- metadata.gz: 085c721ae870334c7633f1cc19f605b6cc656b46ecf1dcf605252a996cce699e5bd44583fa55fa35e653bfd6442229a998d11384ef49c754273c4aaffdd9bf09
7
- data.tar.gz: 8257554a0bac0ca4dc6b6a7a4681a7ce4a2b54c18b209dd5625333661df7cab220d5f036b452a73d54b9884aaf794a9a0a155844709547996fce918ab95016e9
6
+ metadata.gz: adff2b1cb9c1e2f686d18faf5e756fdfb8a78f36901f8bc4832993b058cd687f4616d5ec6385e3abbbb576e99b3969576272424af9fb3bb74ac93e2a9fc10653
7
+ data.tar.gz: c09d2bf09f038e1e6e4e77acd0dd4a76a28be684957de0fbef0a25787b7abc901b43807502bf24d6b1d31d96e24e15763abb4531142c683c9cfac79ed4f5b0ac
@@ -1,3 +1,5 @@
1
+ # 2.2.0
2
+ * Bump manticore version to be at least 0.5.2 for #close support
1
3
  # 2.1.0
2
4
  * Default `automatic_retries` to 1 to fix connections to hosts with broken keepalive
3
5
  * Add `non_idempotent_retries` option
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-mixin-http_client'
3
- s.version = '2.1.0'
3
+ s.version = '2.2.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "AWS mixins to provide a unified interface for Amazon Webservice"
6
6
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  # Gem dependencies
19
19
  s.add_runtime_dependency "logstash-core", ">= 2.0.0.beta2", "< 3.0.0"
20
20
  s.add_runtime_dependency 'logstash-codec-plain'
21
- s.add_runtime_dependency 'manticore', '>= 0.4.1'
21
+ s.add_runtime_dependency 'manticore', '>= 0.5.2', '< 1.0.0'
22
22
 
23
23
  s.add_development_dependency 'logstash-devutils'
24
24
  s.add_development_dependency 'stud'
metadata CHANGED
@@ -1,91 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-mixin-http_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: logstash-core
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
- - - ">="
17
+ - - '>='
17
18
  - !ruby/object:Gem::Version
18
19
  version: 2.0.0.beta2
19
- - - "<"
20
+ - - <
20
21
  - !ruby/object:Gem::Version
21
22
  version: 3.0.0
22
- name: logstash-core
23
- prerelease: false
24
- type: :runtime
25
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
26
24
  requirements:
27
- - - ">="
25
+ - - '>='
28
26
  - !ruby/object:Gem::Version
29
27
  version: 2.0.0.beta2
30
- - - "<"
28
+ - - <
31
29
  - !ruby/object:Gem::Version
32
30
  version: 3.0.0
31
+ prerelease: false
32
+ type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
+ name: logstash-codec-plain
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
34
40
  requirement: !ruby/object:Gem::Requirement
35
41
  requirements:
36
- - - ">="
42
+ - - '>='
37
43
  - !ruby/object:Gem::Version
38
44
  version: '0'
39
- name: logstash-codec-plain
40
45
  prerelease: false
41
46
  type: :runtime
47
+ - !ruby/object:Gem::Dependency
48
+ name: manticore
42
49
  version_requirements: !ruby/object:Gem::Requirement
43
50
  requirements:
44
- - - ">="
51
+ - - '>='
45
52
  - !ruby/object:Gem::Version
46
- version: '0'
47
- - !ruby/object:Gem::Dependency
53
+ version: 0.5.2
54
+ - - <
55
+ - !ruby/object:Gem::Version
56
+ version: 1.0.0
48
57
  requirement: !ruby/object:Gem::Requirement
49
58
  requirements:
50
- - - ">="
59
+ - - '>='
51
60
  - !ruby/object:Gem::Version
52
- version: 0.4.1
53
- name: manticore
61
+ version: 0.5.2
62
+ - - <
63
+ - !ruby/object:Gem::Version
64
+ version: 1.0.0
54
65
  prerelease: false
55
66
  type: :runtime
67
+ - !ruby/object:Gem::Dependency
68
+ name: logstash-devutils
56
69
  version_requirements: !ruby/object:Gem::Requirement
57
70
  requirements:
58
- - - ">="
71
+ - - '>='
59
72
  - !ruby/object:Gem::Version
60
- version: 0.4.1
61
- - !ruby/object:Gem::Dependency
73
+ version: '0'
62
74
  requirement: !ruby/object:Gem::Requirement
63
75
  requirements:
64
- - - ">="
76
+ - - '>='
65
77
  - !ruby/object:Gem::Version
66
78
  version: '0'
67
- name: logstash-devutils
68
79
  prerelease: false
69
80
  type: :development
81
+ - !ruby/object:Gem::Dependency
82
+ name: stud
70
83
  version_requirements: !ruby/object:Gem::Requirement
71
84
  requirements:
72
- - - ">="
85
+ - - '>='
73
86
  - !ruby/object:Gem::Version
74
87
  version: '0'
75
- - !ruby/object:Gem::Dependency
76
88
  requirement: !ruby/object:Gem::Requirement
77
89
  requirements:
78
- - - ">="
90
+ - - '>='
79
91
  - !ruby/object:Gem::Version
80
92
  version: '0'
81
- name: stud
82
93
  prerelease: false
83
94
  type: :development
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
95
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
90
96
  email: info@elastic.co
91
97
  executables: []
@@ -98,7 +104,6 @@ files:
98
104
  - LICENSE
99
105
  - README.md
100
106
  - lib/logstash/plugin_mixins/http_client.rb
101
- - lib/logstash/plugin_mixins/http_client.rb~
102
107
  - logstash-mixin-http_client.gemspec
103
108
  - spec/plugin_mixin/http_client_spec.rb
104
109
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
@@ -111,12 +116,12 @@ require_paths:
111
116
  - lib
112
117
  required_ruby_version: !ruby/object:Gem::Requirement
113
118
  requirements:
114
- - - ">="
119
+ - - '>='
115
120
  - !ruby/object:Gem::Version
116
121
  version: '0'
117
122
  required_rubygems_version: !ruby/object:Gem::Requirement
118
123
  requirements:
119
- - - ">="
124
+ - - '>='
120
125
  - !ruby/object:Gem::Version
121
126
  version: '0'
122
127
  requirements: []
@@ -1,163 +0,0 @@
1
- # encoding: utf-8
2
- require "logstash/config/mixin"
3
-
4
- # This module makes it easy to add a very fully configured HTTP client to logstash
5
- # based on [Manticore](https://github.com/cheald/manticore).
6
- # For an example of its usage see https://github.com/logstash-plugins/logstash-input-http_poller
7
- module LogStash::PluginMixins::HttpClient
8
- class InvalidHTTPConfigError < StandardError; end
9
-
10
- def self.included(base)
11
- require 'manticore'
12
- base.extend(self)
13
- base.setup_http_client_config
14
- end
15
-
16
- public
17
- def setup_http_client_config
18
- # Timeout (in seconds) for the entire request
19
- config :request_timeout, :validate => :number, :default => 60
20
-
21
- # Timeout (in seconds) to wait for data on the socket. Default is `10s`
22
- config :socket_timeout, :validate => :number, :default => 10
23
-
24
- # Timeout (in seconds) to wait for a connection to be established. Default is `10s`
25
- config :connect_timeout, :validate => :number, :default => 10
26
-
27
- # Should redirects be followed? Defaults to `true`
28
- config :follow_redirects, :validate => :boolean, :default => true
29
-
30
- # Max number of concurrent connections. Defaults to `50`
31
- config :pool_max, :validate => :number, :default => 50
32
-
33
- # Max number of concurrent connections to a single host. Defaults to `25`
34
- config :pool_max_per_route, :validate => :number, :default => 25
35
-
36
- # Turn this on to enable HTTP keepalive support. We highly recommend setting `automatic_retries` to at least
37
- # one with this to fix interactions with broken keepalive implementations.
38
- config :keepalive, :validate => :boolean, :default => true
39
-
40
- # How many times should the client retry a failing URL? We highly recommend NOT setting this value
41
- # to zero if keepalive is enabled. Some servers incorrectly end keepalives early requiring a retry!
42
- # Note, `retry_non_idempotent` is set only GET, HEAD, PUT, DELETE, OPTIONS, and TRACE requests will be retried.
43
- config :automatic_retries, :validate => :number, :default => 1
44
-
45
- # If `automatic_retries` is enabled this will cause non-idempotent HTTP verbs (such as POST) to be retried.
46
- config :retry_non_idempotent, :validate => :boolean, :default => false
47
-
48
- # Set this to false to disable SSL/TLS certificate validation
49
- # Note: setting this to false is generally considered insecure!
50
- config :ssl_certificate_validation, :validate => :boolean, :default => true
51
-
52
- # If you need to use a custom X.509 CA (.pem certs) specify the path to that here
53
- config :cacert, :validate => :path
54
-
55
- # If you'd like to use a client certificate (note, most people don't want this) set the path to the x509 cert here
56
- config :client_cert, :validate => :path
57
- # If you're using a client certificate specify the path to the encryption key here
58
- config :client_key, :validate => :path
59
-
60
- # If you need to use a custom keystore (`.jks`) specify that here. This does not work with .pem keys!
61
- config :keystore, :validate => :path
62
-
63
- # Specify the keystore password here.
64
- # Note, most .jks files created with keytool require a password!
65
- config :keystore_password, :validate => :password
66
-
67
- # Specify the keystore type here. One of `JKS` or `PKCS12`. Default is `JKS`
68
- config :keystore_type, :validate => :string, :default => "JKS"
69
-
70
- # If you need to use a custom truststore (`.jks`) specify that here. This does not work with .pem certs!
71
- config :truststore, :validate => :path
72
-
73
- # Specify the truststore password here.
74
- # Note, most .jks files created with keytool require a password!
75
- config :truststore_password, :validate => :password
76
-
77
- # Specify the truststore type here. One of `JKS` or `PKCS12`. Default is `JKS`
78
- config :truststore_type, :validate => :string, :default => "JKS"
79
-
80
- # Enable cookie support. With this enabled the client will persist cookies
81
- # across requests as a normal web browser would. Enabled by default
82
- config :cookies, :validate => :boolean, :default => true
83
-
84
- # If you'd like to use an HTTP proxy . This supports multiple configuration syntaxes:
85
- #
86
- # 1. Proxy host in form: `http://proxy.org:1234`
87
- # 2. Proxy host in form: `{host => "proxy.org", port => 80, scheme => 'http', user => 'username@host', password => 'password'}`
88
- # 3. Proxy host in form: `{url => 'http://proxy.org:1234', user => 'username@host', password => 'password'}`
89
- config :proxy
90
- end
91
-
92
- public
93
- def client_config
94
- c = {
95
- connect_timeout: @connect_timeout,
96
- socket_timeout: @socket_timeout,
97
- request_timeout: @request_timeout,
98
- follow_redirects: @follow_redirects,
99
- automatic_retries: @automatic_retries,
100
- retry_non_idempotent: @retry_non_idempotent,
101
- pool_max: @pool_max,
102
- pool_max_per_route: @pool_max_per_route,
103
- cookies: @cookies,
104
- keepalive: @keepalive,
105
- verify: @ssl_certificate_validation
106
- }
107
-
108
- if @proxy
109
- # Symbolize keys if necessary
110
- c[:proxy] = @proxy.is_a?(Hash) ?
111
- @proxy.reduce({}) {|memo,(k,v)| memo[k.to_sym] = v; memo} :
112
- @proxy
113
- end
114
-
115
- c[:ssl] = {}
116
- if @cacert
117
- c[:ssl][:ca_file] = @cacert
118
- end
119
-
120
- if @truststore
121
- c[:ssl].merge!(
122
- :truststore => @truststore,
123
- :truststore_type => @truststore_type
124
- )
125
-
126
- # JKS files have optional passwords if programatically created
127
- if (@truststore_password)
128
- c[:ssl].merge!(truststore_password: @truststore_password.value)
129
- end
130
- end
131
-
132
- if @keystore
133
- c[:ssl].merge!(
134
- :keystore => @keystore,
135
- :keystore_type => @keystore_type
136
- )
137
-
138
- # JKS files have optional passwords if programatically created
139
- if keystore_password
140
- c[:ssl].merge!(keystore_password: @keystore_password.value)
141
- end
142
- end
143
-
144
- if @client_cert && @client_key
145
- c[:ssl][:client_cert] = @client_cert
146
- c[:ssl][:client_key] = @client_key
147
- elsif !!@client_cert ^ !!@client_key
148
- raise InvalidHTTPConfigError, "You must specify both client_cert and client_key for an HTTP client, or neither!"
149
- end
150
-
151
- c
152
- end
153
-
154
- private
155
- def make_client
156
- Manticore::Client.new(client_config)
157
- end
158
-
159
- public
160
- def client
161
- @client ||= make_client
162
- end
163
- end