vault 0.18.2 → 0.19.0

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.
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.18.2
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-27 00:00:00.000000000 Z
11
+ date: 2025-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sigv4
@@ -24,6 +24,54 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: base64
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: connection_pool
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.4'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: net-http-persistent
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 4.0.2
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '4.0'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 4.0.2
27
75
  - !ruby/object:Gem::Dependency
28
76
  name: bundler
29
77
  requirement: !ruby/object:Gem::Requirement
@@ -164,15 +212,8 @@ files:
164
212
  - lib/vault/defaults.rb
165
213
  - lib/vault/encode.rb
166
214
  - lib/vault/errors.rb
167
- - lib/vault/persistent.rb
168
- - lib/vault/persistent/connection.rb
169
- - lib/vault/persistent/pool.rb
170
- - lib/vault/persistent/timed_stack_multi.rb
171
215
  - lib/vault/request.rb
172
216
  - lib/vault/response.rb
173
- - lib/vault/vendor/connection_pool.rb
174
- - lib/vault/vendor/connection_pool/timed_stack.rb
175
- - lib/vault/vendor/connection_pool/version.rb
176
217
  - lib/vault/version.rb
177
218
  homepage: https://github.com/hashicorp/vault-ruby
178
219
  licenses:
@@ -186,14 +227,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
227
  requirements:
187
228
  - - ">="
188
229
  - !ruby/object:Gem::Version
189
- version: '2.0'
230
+ version: '3.1'
190
231
  required_rubygems_version: !ruby/object:Gem::Requirement
191
232
  requirements:
192
233
  - - ">="
193
234
  - !ruby/object:Gem::Version
194
235
  version: '0'
195
236
  requirements: []
196
- rubygems_version: 3.4.10
237
+ rubygems_version: 3.5.16
197
238
  signing_key:
198
239
  specification_version: 4
199
240
  summary: Vault is a Ruby API client for interacting with a Vault server.
@@ -1,45 +0,0 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
- ##
5
- # A Net::HTTP connection wrapper that holds extra information for managing the
6
- # connection's lifetime.
7
-
8
- module Vault
9
- class PersistentHTTP::Connection # :nodoc:
10
-
11
- attr_accessor :http
12
-
13
- attr_accessor :last_use
14
-
15
- attr_accessor :requests
16
-
17
- attr_accessor :ssl_generation
18
-
19
- def initialize http_class, http_args, ssl_generation
20
- @http = http_class.new(*http_args)
21
- @ssl_generation = ssl_generation
22
-
23
- reset
24
- end
25
-
26
- def finish
27
- @http.finish
28
- rescue IOError
29
- ensure
30
- reset
31
- end
32
-
33
- def reset
34
- @last_use = PersistentHTTP::EPOCH
35
- @requests = 0
36
- end
37
-
38
- def ressl ssl_generation
39
- @ssl_generation = ssl_generation
40
-
41
- finish
42
- end
43
-
44
- end
45
- end
@@ -1,51 +0,0 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
- module Vault
5
- class PersistentHTTP::Pool < Vault::ConnectionPool # :nodoc:
6
-
7
- attr_reader :available # :nodoc:
8
- attr_reader :key # :nodoc:
9
-
10
- def initialize(options = {}, &block)
11
- super
12
-
13
- @available = PersistentHTTP::TimedStackMulti.new(@size, &block)
14
- @key = :"current-#{@available.object_id}"
15
- end
16
-
17
- def checkin net_http_args
18
- stack = Thread.current[@key][net_http_args]
19
-
20
- raise ConnectionPool::Error, 'no connections are checked out' if
21
- stack.empty?
22
-
23
- conn = stack.pop
24
-
25
- if stack.empty?
26
- @available.push conn, connection_args: net_http_args
27
- end
28
-
29
- nil
30
- end
31
-
32
- def checkout net_http_args
33
- stacks = Thread.current[@key] ||= Hash.new { |h, k| h[k] = [] }
34
- stack = stacks[net_http_args]
35
-
36
- if stack.empty? then
37
- conn = @available.pop @timeout, connection_args: net_http_args
38
- else
39
- conn = stack.last
40
- end
41
-
42
- stack.push conn
43
-
44
- conn
45
- end
46
-
47
- end
48
- end
49
-
50
- require_relative 'timed_stack_multi'
51
-
@@ -1,73 +0,0 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
- module Vault
5
- class PersistentHTTP::TimedStackMulti < ConnectionPool::TimedStack # :nodoc:
6
-
7
- def initialize(size = 0, &block)
8
- super
9
-
10
- @enqueued = 0
11
- @ques = Hash.new { |h, k| h[k] = [] }
12
- @lru = {}
13
- @key = :"connection_args-#{object_id}"
14
- end
15
-
16
- def empty?
17
- (@created - @enqueued) >= @max
18
- end
19
-
20
- def length
21
- @max - @created + @enqueued
22
- end
23
-
24
- private
25
-
26
- def connection_stored? options = {} # :nodoc:
27
- !@ques[options[:connection_args]].empty?
28
- end
29
-
30
- def fetch_connection options = {} # :nodoc:
31
- connection_args = options[:connection_args]
32
-
33
- @enqueued -= 1
34
- lru_update connection_args
35
- @ques[connection_args].pop
36
- end
37
-
38
- def lru_update connection_args # :nodoc:
39
- @lru.delete connection_args
40
- @lru[connection_args] = true
41
- end
42
-
43
- def shutdown_connections # :nodoc:
44
- @ques.each_key do |key|
45
- super connection_args: key
46
- end
47
- end
48
-
49
- def store_connection obj, options = {} # :nodoc:
50
- @ques[options[:connection_args]].push obj
51
- @enqueued += 1
52
- end
53
-
54
- def try_create options = {} # :nodoc:
55
- connection_args = options[:connection_args]
56
-
57
- if @created >= @max && @enqueued >= 1
58
- oldest, = @lru.first
59
- @lru.delete oldest
60
- @ques[oldest].pop
61
-
62
- @created -= 1
63
- end
64
-
65
- if @created < @max
66
- @created += 1
67
- lru_update connection_args
68
- return @create_block.call(connection_args)
69
- end
70
- end
71
-
72
- end
73
- end