vault 0.7.2 → 0.7.3
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 +8 -0
- data/lib/vault/client.rb +61 -48
- data/lib/vault/persistent.rb +1 -1
- data/lib/vault/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49716b95ff7c1b7e1a0a8a2d453ead50ff87c958
|
4
|
+
data.tar.gz: feaa17a437a8b90822902c3242bd0cd1d6ad9e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92a96b4abdfd34d4c9432d4ef1e04a4619b855d10c5432d89620f3095b958f4982d188e9251697683cabcf803c112608e645919819068fcd7cb0508474dd01ff
|
7
|
+
data.tar.gz: 2757bdad26d92299f73ded6cefca605f4f28c528737f6ab790303c61634e15000c1d8ed08fee299bfb5ec5ffcf245884814acd87c91e22d5b85033ded005ea41
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Vault Ruby Changelog
|
2
2
|
|
3
|
+
## v0.7.3 (October 25, 2016)
|
4
|
+
|
5
|
+
BUG FIXES
|
6
|
+
|
7
|
+
- Allow options to be set on `Vault` as well as any `Vault::Client`
|
8
|
+
instance to be used properly.
|
9
|
+
- Remove Ruby 2.0 syntax in favor of Ruby 1.9
|
10
|
+
|
3
11
|
## v0.7.2 (October 24, 2016)
|
4
12
|
|
5
13
|
BUG FIXES
|
data/lib/vault/client.rb
CHANGED
@@ -75,72 +75,85 @@ module Vault
|
|
75
75
|
instance_variable_set(:"@#{key}", value)
|
76
76
|
end
|
77
77
|
|
78
|
-
@
|
78
|
+
@lock = Mutex.new
|
79
|
+
@nhp = nil
|
80
|
+
end
|
81
|
+
|
82
|
+
def pool
|
83
|
+
@lock.synchronize do
|
84
|
+
return @nhp if @nhp
|
85
|
+
|
86
|
+
@nhp = PersistentHTTP.new(name: "vault-ruby")
|
79
87
|
|
80
|
-
|
81
|
-
|
88
|
+
if proxy_address
|
89
|
+
proxy_uri = URI.parse "http://#{proxy_address}"
|
82
90
|
|
83
|
-
|
91
|
+
proxy_uri.port = proxy_port if proxy_port
|
84
92
|
|
85
|
-
|
86
|
-
|
87
|
-
|
93
|
+
if proxy_username
|
94
|
+
proxy_uri.user = proxy_username
|
95
|
+
proxy_uri.password = proxy_password
|
96
|
+
end
|
97
|
+
|
98
|
+
@nhp.proxy = proxy_uri
|
88
99
|
end
|
89
100
|
|
90
|
-
|
91
|
-
|
101
|
+
# Use a custom open timeout
|
102
|
+
if open_timeout || timeout
|
103
|
+
@nhp.open_timeout = (open_timeout || timeout).to_i
|
104
|
+
end
|
92
105
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
106
|
+
# Use a custom read timeout
|
107
|
+
if read_timeout || timeout
|
108
|
+
@nhp.read_timeout = (read_timeout || timeout).to_i
|
109
|
+
end
|
97
110
|
|
98
|
-
|
99
|
-
if read_timeout || timeout
|
100
|
-
@nhp.read_timeout = (read_timeout || timeout).to_i
|
101
|
-
end
|
111
|
+
@nhp.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
102
112
|
|
103
|
-
|
113
|
+
# Vault requires TLS1.2
|
114
|
+
@nhp.ssl_version = "TLSv1_2"
|
104
115
|
|
105
|
-
|
106
|
-
|
116
|
+
# Only use secure ciphers
|
117
|
+
@nhp.ciphers = ssl_ciphers
|
107
118
|
|
108
|
-
|
109
|
-
|
119
|
+
# Custom pem files, no problem!
|
120
|
+
pem = ssl_pem_contents || (ssl_pem_file ? File.read(ssl_pem_file) : nil)
|
121
|
+
if pem
|
122
|
+
@nhp.cert = OpenSSL::X509::Certificate.new(pem)
|
123
|
+
@nhp.key = OpenSSL::PKey::RSA.new(pem, ssl_pem_passphrase)
|
124
|
+
end
|
110
125
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
@nhp.key = OpenSSL::PKey::RSA.new(pem, ssl_pem_passphrase)
|
116
|
-
end
|
126
|
+
# Use custom CA cert for verification
|
127
|
+
if ssl_ca_cert
|
128
|
+
@nhp.ca_file = ssl_ca_cert
|
129
|
+
end
|
117
130
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
131
|
+
# Use custom CA path that contains CA certs
|
132
|
+
if ssl_ca_path
|
133
|
+
@nhp.ca_path = ssl_ca_path
|
134
|
+
end
|
122
135
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
end
|
136
|
+
if ssl_cert_store
|
137
|
+
@nhp.cert_store = ssl_cert_store
|
138
|
+
end
|
127
139
|
|
128
|
-
|
129
|
-
|
130
|
-
|
140
|
+
# Naughty, naughty, naughty! Don't blame me when someone hops in
|
141
|
+
# and executes a MITM attack!
|
142
|
+
if !ssl_verify
|
143
|
+
@nhp.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
144
|
+
end
|
131
145
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
end
|
146
|
+
# Use custom timeout for connecting and verifying via SSL
|
147
|
+
if ssl_timeout || timeout
|
148
|
+
@nhp.ssl_timeout = (ssl_timeout || timeout).to_i
|
149
|
+
end
|
137
150
|
|
138
|
-
|
139
|
-
if ssl_timeout || timeout
|
140
|
-
@nhp.ssl_timeout = (ssl_timeout || timeout).to_i
|
151
|
+
@nhp
|
141
152
|
end
|
142
153
|
end
|
143
154
|
|
155
|
+
private :pool
|
156
|
+
|
144
157
|
# Creates and yields a new client object with the given token. This may be
|
145
158
|
# used safely in a threadsafe manner because the original client remains
|
146
159
|
# unchanged. The value of the block is returned.
|
@@ -253,7 +266,7 @@ module Vault
|
|
253
266
|
begin
|
254
267
|
# Create a connection using the block form, which will ensure the socket
|
255
268
|
# is properly closed in the event of an error.
|
256
|
-
response =
|
269
|
+
response = pool.request(uri, request)
|
257
270
|
|
258
271
|
case response
|
259
272
|
when Net::HTTPRedirection
|
data/lib/vault/persistent.rb
CHANGED
@@ -505,7 +505,7 @@ class PersistentHTTP
|
|
505
505
|
# Defaults to 1/4 the number of allowed file handles. You can have no more
|
506
506
|
# than this many threads with active HTTP transactions.
|
507
507
|
|
508
|
-
def initialize name
|
508
|
+
def initialize name=nil, proxy=nil, pool_size=DEFAULT_POOL_SIZE
|
509
509
|
@name = name
|
510
510
|
|
511
511
|
@debug_output = nil
|
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.3
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|