vault 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/vault/client.rb +3 -4
- data/lib/vault/{vendor/net/http/persistent.rb → persistent.rb} +16 -15
- data/lib/vault/{vendor/net/http/persistent → persistent}/connection.rb +2 -2
- data/lib/vault/{vendor/net/http/persistent → persistent}/pool.rb +2 -2
- data/lib/vault/{vendor/net/http/persistent → persistent}/timed_stack_multi.rb +1 -1
- data/lib/vault/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17c7b7d52eaf25c26decc7297cff321cb39874c8
|
4
|
+
data.tar.gz: 553f4ded368aaff1b8cf9a44c8dc1fc200a488bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3aca22bda4c5676b95acb887d1fc887781a896f0da9f76a1fba43a2b5676ef895f022cc2045bcc0b96ff5056d1e260da39a04e162ef756c011c2ed03f756fa9
|
7
|
+
data.tar.gz: 1148bc3d5e61bbad1703c5bb68d5fc7657c551fbb00f71b6534f6a44bb82eb102d1a5ddb80a2aefca7f248734d5fd342ff4ecd2d9be618ba0e70676922a89d28
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Vault Ruby Changelog
|
2
2
|
|
3
|
+
## v0.7.1 (October 21, 2016)
|
4
|
+
|
5
|
+
BUG FIXES
|
6
|
+
|
7
|
+
- Properly vendor Net::HTTP::Persistent so that it doesn't collide
|
8
|
+
with net-http-persistent
|
9
|
+
- Fix behavior where `verify_mode` was forced to `VERIFY_PEER`
|
10
|
+
if a custom CA was set
|
11
|
+
|
3
12
|
## v0.7.0 (October 18, 2016)
|
4
13
|
|
5
14
|
DEPRECATIONS
|
data/lib/vault/client.rb
CHANGED
@@ -2,8 +2,7 @@ require "cgi"
|
|
2
2
|
require "json"
|
3
3
|
require "uri"
|
4
4
|
|
5
|
-
require_relative "
|
6
|
-
|
5
|
+
require_relative "persistent"
|
7
6
|
require_relative "configurable"
|
8
7
|
require_relative "errors"
|
9
8
|
require_relative "version"
|
@@ -55,7 +54,7 @@ module Vault
|
|
55
54
|
a << Net::ReadTimeout if defined?(Net::ReadTimeout)
|
56
55
|
a << Net::OpenTimeout if defined?(Net::OpenTimeout)
|
57
56
|
|
58
|
-
a <<
|
57
|
+
a << PersistentHTTP::Error
|
59
58
|
end.freeze
|
60
59
|
|
61
60
|
# Indicates a requested operation is not possible due to security
|
@@ -76,7 +75,7 @@ module Vault
|
|
76
75
|
instance_variable_set(:"@#{key}", value)
|
77
76
|
end
|
78
77
|
|
79
|
-
@nhp =
|
78
|
+
@nhp = PersistentHTTP.new(name: "vault-ruby")
|
80
79
|
|
81
80
|
if proxy_address
|
82
81
|
proxy_uri = URI.parse "http://#{proxy_address}"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# Vendored and modified from github.com/drbrain/net-http-persistent
|
2
|
+
#
|
1
3
|
require 'net/http'
|
2
4
|
require 'uri'
|
3
5
|
require 'cgi' # for escaping
|
@@ -13,18 +15,18 @@ autoload :OpenSSL, 'openssl'
|
|
13
15
|
##
|
14
16
|
# Persistent connections for Net::HTTP
|
15
17
|
#
|
16
|
-
#
|
18
|
+
# PersistentHTTP maintains persistent connections across all the
|
17
19
|
# servers you wish to talk to. For each host:port you communicate with a
|
18
20
|
# single persistent connection is created.
|
19
21
|
#
|
20
|
-
# Multiple
|
22
|
+
# Multiple PersistentHTTP objects will share the same set of
|
21
23
|
# connections.
|
22
24
|
#
|
23
25
|
# For each thread you start a new connection will be created. A
|
24
|
-
#
|
26
|
+
# PersistentHTTP connection will not be shared across threads.
|
25
27
|
#
|
26
28
|
# You can shut down the HTTP connections when done by calling #shutdown. You
|
27
|
-
# should name your
|
29
|
+
# should name your PersistentHTTP object if you intend to call this
|
28
30
|
# method.
|
29
31
|
#
|
30
32
|
# Example:
|
@@ -33,7 +35,7 @@ autoload :OpenSSL, 'openssl'
|
|
33
35
|
#
|
34
36
|
# uri = URI 'http://example.com/awesome/web/service'
|
35
37
|
#
|
36
|
-
# http =
|
38
|
+
# http = PersistentHTTP.new 'my_app_name'
|
37
39
|
#
|
38
40
|
# # perform a GET
|
39
41
|
# response = http.request uri
|
@@ -153,14 +155,14 @@ autoload :OpenSSL, 'openssl'
|
|
153
155
|
# uri = URI 'http://example.com/awesome/web/service'
|
154
156
|
# post_uri = uri + 'create'
|
155
157
|
#
|
156
|
-
# http =
|
158
|
+
# http = PersistentHTTP.new 'my_app_name'
|
157
159
|
#
|
158
160
|
# post = Net::HTTP::Post.new post_uri.path
|
159
161
|
# # ... fill in POST request
|
160
162
|
#
|
161
163
|
# begin
|
162
164
|
# response = http.request post_uri, post
|
163
|
-
# rescue
|
165
|
+
# rescue PersistentHTTP::Error
|
164
166
|
#
|
165
167
|
# # POST failed, make a new request to verify the server did not process
|
166
168
|
# # the request
|
@@ -177,7 +179,7 @@ autoload :OpenSSL, 'openssl'
|
|
177
179
|
#
|
178
180
|
# === Connection Termination
|
179
181
|
#
|
180
|
-
# If you are done using the
|
182
|
+
# If you are done using the PersistentHTTP instance you may shut down
|
181
183
|
# all the connections in the current thread with #shutdown. This is not
|
182
184
|
# recommended for normal use, it should only be used when it will be several
|
183
185
|
# minutes before you make another HTTP request.
|
@@ -188,7 +190,7 @@ autoload :OpenSSL, 'openssl'
|
|
188
190
|
# when the thread terminates.
|
189
191
|
|
190
192
|
module Vault
|
191
|
-
class
|
193
|
+
class PersistentHTTP
|
192
194
|
|
193
195
|
##
|
194
196
|
# The beginning of Time
|
@@ -206,7 +208,7 @@ class Net::HTTP::Persistent
|
|
206
208
|
DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4
|
207
209
|
|
208
210
|
##
|
209
|
-
# The version of
|
211
|
+
# The version of PersistentHTTP you are using
|
210
212
|
|
211
213
|
VERSION = '3.0.0'
|
212
214
|
|
@@ -226,7 +228,7 @@ class Net::HTTP::Persistent
|
|
226
228
|
].compact
|
227
229
|
|
228
230
|
##
|
229
|
-
# Error class for errors raised by
|
231
|
+
# Error class for errors raised by PersistentHTTP. Various
|
230
232
|
# SystemCallErrors are re-raised with a human-readable message under this
|
231
233
|
# class.
|
232
234
|
|
@@ -483,7 +485,7 @@ class Net::HTTP::Persistent
|
|
483
485
|
attr_accessor :retry_change_requests
|
484
486
|
|
485
487
|
##
|
486
|
-
# Creates a new
|
488
|
+
# Creates a new PersistentHTTP.
|
487
489
|
#
|
488
490
|
# Set +name+ to keep your connections apart from everybody else's. Not
|
489
491
|
# required currently, but highly recommended. Your library name should be
|
@@ -523,8 +525,8 @@ class Net::HTTP::Persistent
|
|
523
525
|
@socket_options << [Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1] if
|
524
526
|
Socket.const_defined? :TCP_NODELAY
|
525
527
|
|
526
|
-
@pool =
|
527
|
-
|
528
|
+
@pool = PersistentHTTP::Pool.new size: pool_size do |http_args|
|
529
|
+
PersistentHTTP::Connection.new Net::HTTP, http_args, @ssl_generation
|
528
530
|
end
|
529
531
|
|
530
532
|
@certificate = nil
|
@@ -1080,7 +1082,6 @@ application:
|
|
1080
1082
|
connection.ca_path = @ca_path if @ca_path
|
1081
1083
|
|
1082
1084
|
if @ca_file or @ca_path then
|
1083
|
-
connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
1084
1085
|
connection.verify_callback = @verify_callback if @verify_callback
|
1085
1086
|
end
|
1086
1087
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# connection's lifetime.
|
4
4
|
|
5
5
|
module Vault
|
6
|
-
class
|
6
|
+
class PersistentHTTP::Connection # :nodoc:
|
7
7
|
|
8
8
|
attr_accessor :http
|
9
9
|
|
@@ -28,7 +28,7 @@ class Net::HTTP::Persistent::Connection # :nodoc:
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def reset
|
31
|
-
@last_use =
|
31
|
+
@last_use = PersistentHTTP::EPOCH
|
32
32
|
@requests = 0
|
33
33
|
end
|
34
34
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Vault
|
2
|
-
class
|
2
|
+
class PersistentHTTP::Pool < Vault::ConnectionPool # :nodoc:
|
3
3
|
|
4
4
|
attr_reader :available # :nodoc:
|
5
5
|
attr_reader :key # :nodoc:
|
@@ -7,7 +7,7 @@ class Net::HTTP::Persistent::Pool < Vault::ConnectionPool # :nodoc:
|
|
7
7
|
def initialize(options = {}, &block)
|
8
8
|
super
|
9
9
|
|
10
|
-
@available =
|
10
|
+
@available = PersistentHTTP::TimedStackMulti.new(@size, &block)
|
11
11
|
@key = :"current-#{@available.object_id}"
|
12
12
|
end
|
13
13
|
|
data/lib/vault/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vault
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Vargo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -132,15 +132,15 @@ files:
|
|
132
132
|
- lib/vault/defaults.rb
|
133
133
|
- lib/vault/encode.rb
|
134
134
|
- lib/vault/errors.rb
|
135
|
+
- lib/vault/persistent.rb
|
136
|
+
- lib/vault/persistent/connection.rb
|
137
|
+
- lib/vault/persistent/pool.rb
|
138
|
+
- lib/vault/persistent/timed_stack_multi.rb
|
135
139
|
- lib/vault/request.rb
|
136
140
|
- lib/vault/response.rb
|
137
141
|
- lib/vault/vendor/connection_pool.rb
|
138
142
|
- lib/vault/vendor/connection_pool/timed_stack.rb
|
139
143
|
- lib/vault/vendor/connection_pool/version.rb
|
140
|
-
- lib/vault/vendor/net/http/persistent.rb
|
141
|
-
- lib/vault/vendor/net/http/persistent/connection.rb
|
142
|
-
- lib/vault/vendor/net/http/persistent/pool.rb
|
143
|
-
- lib/vault/vendor/net/http/persistent/timed_stack_multi.rb
|
144
144
|
- lib/vault/version.rb
|
145
145
|
- vault.gemspec
|
146
146
|
homepage: https://github.com/hashicorp/vault-ruby
|