vault 0.13.1 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +7 -5
- data/lib/vault/api/sys/namespace.rb +0 -2
- data/lib/vault/api/sys/quota.rb +107 -0
- data/lib/vault/api/sys.rb +1 -0
- data/lib/vault/api/transform/alphabet.rb +43 -0
- data/lib/vault/api/transform/role.rb +42 -0
- data/lib/vault/api/transform/template.rb +54 -0
- data/lib/vault/api/transform/transformation.rb +61 -0
- data/lib/vault/api/transform.rb +29 -0
- data/lib/vault/api.rb +1 -0
- data/lib/vault/client.rb +1 -1
- data/lib/vault/configurable.rb +1 -0
- data/lib/vault/defaults.rb +14 -1
- data/lib/vault/persistent/pool.rb +1 -1
- data/lib/vault/persistent.rb +2 -7
- data/lib/vault/request.rb +1 -0
- data/lib/vault/version.rb +1 -1
- metadata +16 -16
- data/.circleci/config.yml +0 -42
- data/.gitignore +0 -42
- data/.rspec +0 -2
- data/Gemfile +0 -3
- data/Rakefile +0 -6
- data/vault.gemspec +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46c570463a1aba190e789e5b2516b4140d48961611ff058235d3b9744e6a6b24
|
4
|
+
data.tar.gz: c84a96cf71d9f405281f56629e0fb68a6ce051740ea46da60e35cabf37d8b44e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98a20e963ec212e2269d1c28b581c24b356495789b4b37b20ebcb829c17904b518fc32f9cd2dadfcd59b957361410e7aa61f88e7ad419d72533d0ac1bd0ec68d
|
7
|
+
data.tar.gz: 35f0126a7e7ba6173662222a9006cd02bc2f78d6d674533546b68ad87420f99b1e26f1f160058b2a051c36a5faac219921ab24191f9165212ddc8f15c440e0a6
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# Vault Ruby Changelog
|
2
2
|
|
3
|
+
## v0.16.0 (??? ??, 2021)
|
4
|
+
|
5
|
+
IMPROVEMENTS
|
6
|
+
|
7
|
+
- The timeout used to get a connection from the connection pool that talks with vault is now configurable. Using `Vault.pool_timeout` or the env var `VAULT_POOL_TIMEOUT`.
|
8
|
+
|
9
|
+
## v0.15.0 (July 29, 2020)
|
10
|
+
|
11
|
+
IMPROVEMENTS
|
12
|
+
|
13
|
+
- Added support for Resource Quotas
|
14
|
+
|
15
|
+
## v0.14.0 (May 28, 2020)
|
16
|
+
|
17
|
+
IMPROVEMENTS
|
18
|
+
|
19
|
+
- Added support for the Transform Secrets Engine
|
20
|
+
|
21
|
+
## v0.13.2 (May 7, 2020)
|
22
|
+
|
23
|
+
BUG FIXES
|
24
|
+
|
25
|
+
- Fixed the ability to use namespace as an option for each request. Previously, that option was ignored.
|
26
|
+
- aws-sigv4 gem was unlocked after a bug in 1.1.2 broke CI
|
27
|
+
|
3
28
|
## v0.13.1 (April 28, 2020)
|
4
29
|
|
5
30
|
IMPROVEMENTS
|
@@ -7,6 +32,12 @@ IMPROVEMENTS
|
|
7
32
|
- Added support for defining a namespace when initializing the client, as well as options for changing the namespace via method.
|
8
33
|
- Added support for sys/namespaces API. Ability to Get, Create, Delete, and List namespaces has been provided.
|
9
34
|
|
35
|
+
## v0.13.0 (October 1, 2019)
|
36
|
+
|
37
|
+
IMPROVEMENTS
|
38
|
+
|
39
|
+
- Add support for versioned KV secrets in the client
|
40
|
+
|
10
41
|
## v0.12.0 (August 14, 2018)
|
11
42
|
|
12
43
|
IMPROVEMENTS
|
data/README.md
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
Vault Ruby Client [![Build Status](https://
|
1
|
+
Vault Ruby Client [![Build Status](https://circleci.com/gh/hashicorp/vault-ruby.svg?style=shield)](https://circleci.com/gh/hashicorp/vault-ruby)
|
2
2
|
=================
|
3
3
|
|
4
4
|
Vault is the official Ruby client for interacting with [Vault](https://vaultproject.io) by HashiCorp.
|
5
5
|
|
6
|
-
**
|
6
|
+
**If you're viewing this README from GitHub on the `master` branch, know that it may contain unreleased features or
|
7
|
+
different APIs than the most recently released version. Please see the Git tag that corresponds to your version of the
|
8
|
+
Vault Ruby client for the proper documentation.**
|
7
9
|
|
8
10
|
Quick Start
|
9
11
|
-----------
|
10
12
|
Install Ruby 2.0+: [Guide](https://www.ruby-lang.org/en/documentation/installation/).
|
11
13
|
|
12
|
-
> Please note that
|
14
|
+
> Please note that as of Vault Ruby version 0.14.0 versions of Ruby prior to 2.0 are no longer supported.
|
13
15
|
|
14
16
|
Install via Rubygems:
|
15
17
|
|
@@ -18,7 +20,7 @@ Install via Rubygems:
|
|
18
20
|
or add it to your Gemfile if you're using Bundler:
|
19
21
|
|
20
22
|
```ruby
|
21
|
-
gem "vault"
|
23
|
+
gem "vault"
|
22
24
|
```
|
23
25
|
|
24
26
|
and then run the `bundle` command to install.
|
@@ -214,7 +216,7 @@ Development
|
|
214
216
|
Important Notes:
|
215
217
|
|
216
218
|
- **All new features must include test coverage.** At a bare minimum, Unit tests are required. It is preferred if you include integration tests as well.
|
217
|
-
- **The tests must be
|
219
|
+
- **The tests must be idempotent.** The HTTP calls made during a test should be able to be run over and over.
|
218
220
|
- **Tests are order independent.** The default RSpec configuration randomizes the test order, so this should not be a problem.
|
219
221
|
- **Integration tests require Vault** Vault must be available in the path for the integration tests to pass.
|
220
222
|
- **In order to be considered an integration test:** The test MUST use the `vault_test_client` or `vault_redirect_test_client` as the client. This spawns a process, or uses an already existing process from another test, to run against.
|
@@ -18,8 +18,6 @@ module Vault
|
|
18
18
|
# Vault.sys.namespaces #=> { :foo => #<struct Vault::Namespace id="xxxx1", path="foo/" }
|
19
19
|
#
|
20
20
|
# @return [Hash<Symbol, Namespace>]
|
21
|
-
#
|
22
|
-
# NOTE: Due to a bug in Vault Enterprise, to be fixed soon, this method CAN return a pure JSON string if a scoping namespace is provided.
|
23
21
|
def namespaces(scoped=nil)
|
24
22
|
path = ["v1", scoped, "sys", "namespaces"].compact
|
25
23
|
json = client.list(path.join("/"))
|
@@ -0,0 +1,107 @@
|
|
1
|
+
module Vault
|
2
|
+
class Quota < Response
|
3
|
+
# @!attribute [r] name
|
4
|
+
# Name of the quota rule.
|
5
|
+
# @return [String]
|
6
|
+
field :name
|
7
|
+
|
8
|
+
# @!attribute [r] path
|
9
|
+
# Namespace/Path combination the quota applies to.
|
10
|
+
# @return [String]
|
11
|
+
field :path
|
12
|
+
|
13
|
+
# @!attribute [r] type
|
14
|
+
# Type of the quota rule, must be one of "lease-count" or "rate-limit"
|
15
|
+
# @return [String]
|
16
|
+
field :type
|
17
|
+
end
|
18
|
+
|
19
|
+
class RateLimitQuota < Quota
|
20
|
+
# @!attribute [r] rate
|
21
|
+
# The rate at which allowed requests are refilled per second by the quota
|
22
|
+
# rule.
|
23
|
+
# @return [Float]
|
24
|
+
field :rate
|
25
|
+
|
26
|
+
# @!attribute [r] burst
|
27
|
+
# The maximum number of requests at any given second allowed by the quota
|
28
|
+
# rule.
|
29
|
+
# @return [Int]
|
30
|
+
field :burst
|
31
|
+
end
|
32
|
+
|
33
|
+
class LeaseCountQuota < Quota
|
34
|
+
# @!attribute [r] counter
|
35
|
+
# Number of currently active leases for the quota.
|
36
|
+
# @return [Int]
|
37
|
+
field :counter
|
38
|
+
|
39
|
+
# @!attribute [r] max_leases
|
40
|
+
# The maximum number of allowed leases for this quota.
|
41
|
+
# @return [Int]
|
42
|
+
field :max_leases
|
43
|
+
end
|
44
|
+
|
45
|
+
class Sys
|
46
|
+
def quotas(type)
|
47
|
+
path = generate_path(type)
|
48
|
+
json = client.list(path)
|
49
|
+
if data = json.dig(:data, :key_info)
|
50
|
+
data.map do |item|
|
51
|
+
type_class(type).decode(item)
|
52
|
+
end
|
53
|
+
else
|
54
|
+
json
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def create_quota(type, name, opts={})
|
59
|
+
path = generate_path(type, name)
|
60
|
+
client.post(path, JSON.fast_generate(opts))
|
61
|
+
return true
|
62
|
+
end
|
63
|
+
|
64
|
+
def delete_quota(type, name)
|
65
|
+
path = generate_path(type, name)
|
66
|
+
client.delete(path)
|
67
|
+
return true
|
68
|
+
end
|
69
|
+
|
70
|
+
def get_quota(type, name)
|
71
|
+
path = generate_path(type, name)
|
72
|
+
response = client.get(path)
|
73
|
+
if data = response[:data]
|
74
|
+
type_class(type).decode(data)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def get_quota_config
|
79
|
+
client.get("v1/sys/quotas/config")
|
80
|
+
end
|
81
|
+
|
82
|
+
def update_quota_config(opts={})
|
83
|
+
client.post("v1/sys/quotas/config", JSON.fast_generate(opts))
|
84
|
+
return true
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
def generate_path(type, name=nil)
|
90
|
+
verify_type(type)
|
91
|
+
path = ["v1", "sys", "quotas", type, name].compact
|
92
|
+
path.join("/")
|
93
|
+
end
|
94
|
+
|
95
|
+
def verify_type(type)
|
96
|
+
return if ["rate-limit", "lease-count"].include?(type)
|
97
|
+
raise ArgumentError, "type must be one of \"rate-limit\" or \"lease-count\""
|
98
|
+
end
|
99
|
+
|
100
|
+
def type_class(type)
|
101
|
+
case type
|
102
|
+
when "lease-count" then LeaseCountQuota
|
103
|
+
when "rate-limit" then RateLimitQuota
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
data/lib/vault/api/sys.rb
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
require_relative '../../request'
|
2
|
+
require_relative '../../response'
|
3
|
+
|
4
|
+
module Vault
|
5
|
+
class Transform < Request
|
6
|
+
class Alphabet < Response
|
7
|
+
# @!attribute [r] id
|
8
|
+
# String listing all possible characters of the alphabet
|
9
|
+
# @return [String]
|
10
|
+
field :alphabet
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_alphabet(name, alphabet:, **opts)
|
14
|
+
opts ||= {}
|
15
|
+
opts[:alphabet] = alphabet
|
16
|
+
client.post("/v1/transform/alphabet/#{encode_path(name)}", JSON.fast_generate(opts))
|
17
|
+
return true
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_alphabet(name)
|
21
|
+
json = client.get("/v1/transform/alphabet/#{encode_path(name)}")
|
22
|
+
if data = json.dig(:data)
|
23
|
+
Alphabet.decode(data)
|
24
|
+
else
|
25
|
+
json
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def delete_alphabet(name)
|
30
|
+
client.delete("/v1/transform/alphabet/#{encode_path(name)}")
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
34
|
+
def alphabets
|
35
|
+
json = client.list("/v1/transform/alphabet")
|
36
|
+
if keys = json.dig(:data, :keys)
|
37
|
+
keys
|
38
|
+
else
|
39
|
+
json
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative '../../request'
|
2
|
+
require_relative '../../response'
|
3
|
+
|
4
|
+
module Vault
|
5
|
+
class Transform < Request
|
6
|
+
class Role < Response
|
7
|
+
# @!attribute [r] transformations
|
8
|
+
# Array of all transformations the role has access to
|
9
|
+
# @return [Array<String>]
|
10
|
+
field :transformations
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_role(name, **opts)
|
14
|
+
opts ||= {}
|
15
|
+
client.post("/v1/transform/role/#{encode_path(name)}", JSON.fast_generate(opts))
|
16
|
+
return true
|
17
|
+
end
|
18
|
+
|
19
|
+
def get_role(name)
|
20
|
+
json = client.get("/v1/transform/role/#{encode_path(name)}")
|
21
|
+
if data = json.dig(:data)
|
22
|
+
Role.decode(data)
|
23
|
+
else
|
24
|
+
json
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def delete_role(name)
|
29
|
+
client.delete("/v1/transform/role/#{encode_path(name)}")
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
33
|
+
def roles
|
34
|
+
json = client.list("/v1/transform/role")
|
35
|
+
if keys = json.dig(:data, :keys)
|
36
|
+
keys
|
37
|
+
else
|
38
|
+
json
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require_relative '../../request'
|
2
|
+
require_relative '../../response'
|
3
|
+
|
4
|
+
module Vault
|
5
|
+
class Transform < Request
|
6
|
+
class Template < Response
|
7
|
+
# @!attribute [r] alphabet
|
8
|
+
# Name of the alphabet to be used in the template
|
9
|
+
# @return [String]
|
10
|
+
field :alphabet
|
11
|
+
|
12
|
+
# @!attribute [r] pattern
|
13
|
+
# Regex string to detect and match for the template
|
14
|
+
# @return [String]
|
15
|
+
field :pattern
|
16
|
+
|
17
|
+
# @!attribute [r] type
|
18
|
+
# Type of the template, currently, only "regex" is supported
|
19
|
+
# @return [String]
|
20
|
+
field :type
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_template(name, type:, pattern:, **opts)
|
24
|
+
opts ||= {}
|
25
|
+
opts[:type] = type
|
26
|
+
opts[:pattern] = pattern
|
27
|
+
client.post("/v1/transform/template/#{encode_path(name)}", JSON.fast_generate(opts))
|
28
|
+
return true
|
29
|
+
end
|
30
|
+
|
31
|
+
def get_template(name)
|
32
|
+
json = client.get("/v1/transform/template/#{encode_path(name)}")
|
33
|
+
if data = json.dig(:data)
|
34
|
+
Template.decode(data)
|
35
|
+
else
|
36
|
+
json
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def delete_template(name)
|
41
|
+
client.delete("/v1/transform/template/#{encode_path(name)}")
|
42
|
+
true
|
43
|
+
end
|
44
|
+
|
45
|
+
def templates
|
46
|
+
json = client.list("/v1/transform/template")
|
47
|
+
if keys = json.dig(:data, :keys)
|
48
|
+
keys
|
49
|
+
else
|
50
|
+
json
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require_relative '../../request'
|
2
|
+
require_relative '../../response'
|
3
|
+
|
4
|
+
module Vault
|
5
|
+
class Transform < Request
|
6
|
+
class Transformation < Response
|
7
|
+
# @!attribute [r] allowed_roles
|
8
|
+
# Array of role names that are allowed to use this transformation
|
9
|
+
# @return [Array<String>]
|
10
|
+
field :allowed_roles
|
11
|
+
|
12
|
+
# @!attribute [r] templates
|
13
|
+
# Array of template names accessible to this transformation
|
14
|
+
# @return [Array<String>]
|
15
|
+
field :templates
|
16
|
+
|
17
|
+
# @!attribute [r] tweak_source
|
18
|
+
# String representing how a tweak is provided for this transformation.
|
19
|
+
# Available tweaks are "supplied", "generated", and "internal"
|
20
|
+
# @return [String]
|
21
|
+
field :tweak_source
|
22
|
+
|
23
|
+
# @!attribute [r] type
|
24
|
+
# String representing the type of transformation this is.
|
25
|
+
# Available types are "fpe", and "masking"
|
26
|
+
# @return [String]
|
27
|
+
field :type
|
28
|
+
end
|
29
|
+
|
30
|
+
def create_transformation(name, type:, template:, **opts)
|
31
|
+
opts ||= {}
|
32
|
+
opts[:type] = type
|
33
|
+
opts[:template] = template
|
34
|
+
client.post("/v1/transform/transformation/#{encode_path(name)}", JSON.fast_generate(opts))
|
35
|
+
return true
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_transformation(name)
|
39
|
+
json = client.get("/v1/transform/transformation/#{encode_path(name)}")
|
40
|
+
if data = json.dig(:data)
|
41
|
+
Transformation.decode(data)
|
42
|
+
else
|
43
|
+
json
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def delete_transformation(name)
|
48
|
+
client.delete("/v1/transform/transformation/#{encode_path(name)}")
|
49
|
+
true
|
50
|
+
end
|
51
|
+
|
52
|
+
def transformations
|
53
|
+
json = client.list("/v1/transform/transformation")
|
54
|
+
if keys = json.dig(:data, :keys)
|
55
|
+
keys
|
56
|
+
else
|
57
|
+
json
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require_relative '../client'
|
2
|
+
require_relative '../request'
|
3
|
+
|
4
|
+
module Vault
|
5
|
+
class Client
|
6
|
+
# A proxy to the {Transform} methods.
|
7
|
+
# @return [Transform]
|
8
|
+
def transform
|
9
|
+
@transform ||= Transform.new(self)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Transform < Request
|
14
|
+
def encode(role_name:, **opts)
|
15
|
+
opts ||= {}
|
16
|
+
client.post("/v1/transform/encode/#{encode_path(role_name)}", JSON.fast_generate(opts))
|
17
|
+
end
|
18
|
+
|
19
|
+
def decode(role_name:, **opts)
|
20
|
+
opts ||= {}
|
21
|
+
client.post("/v1/transform/decode/#{encode_path(role_name)}", JSON.fast_generate(opts))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require_relative 'transform/alphabet'
|
27
|
+
require_relative 'transform/role'
|
28
|
+
require_relative 'transform/template'
|
29
|
+
require_relative 'transform/transformation'
|
data/lib/vault/api.rb
CHANGED
data/lib/vault/client.rb
CHANGED
@@ -86,7 +86,7 @@ module Vault
|
|
86
86
|
@lock.synchronize do
|
87
87
|
return @nhp if @nhp
|
88
88
|
|
89
|
-
@nhp = PersistentHTTP.new("vault-ruby", nil, pool_size)
|
89
|
+
@nhp = PersistentHTTP.new("vault-ruby", nil, pool_size, pool_timeout)
|
90
90
|
|
91
91
|
if proxy_address
|
92
92
|
proxy_uri = URI.parse "http://#{proxy_address}"
|
data/lib/vault/configurable.rb
CHANGED
data/lib/vault/defaults.rb
CHANGED
@@ -30,6 +30,9 @@ module Vault
|
|
30
30
|
# The default size of the connection pool
|
31
31
|
DEFAULT_POOL_SIZE = 16
|
32
32
|
|
33
|
+
# The default timeout in seconds for retrieving a connection from the connection pool
|
34
|
+
DEFAULT_POOL_TIMEOUT = 0.5
|
35
|
+
|
33
36
|
# The set of exceptions that are detect and retried by default
|
34
37
|
# with `with_retries`
|
35
38
|
RETRIED_EXCEPTIONS = [HTTPServerError]
|
@@ -85,12 +88,22 @@ module Vault
|
|
85
88
|
# @return Integer
|
86
89
|
def pool_size
|
87
90
|
if var = ENV["VAULT_POOL_SIZE"]
|
88
|
-
|
91
|
+
var.to_i
|
89
92
|
else
|
90
93
|
DEFAULT_POOL_SIZE
|
91
94
|
end
|
92
95
|
end
|
93
96
|
|
97
|
+
# The timeout for getting a connection from the connection pool that communicates with Vault
|
98
|
+
# @return Float
|
99
|
+
def pool_timeout
|
100
|
+
if var = ENV["VAULT_POOL_TIMEOUT"]
|
101
|
+
var.to_f
|
102
|
+
else
|
103
|
+
DEFAULT_POOL_TIMEOUT
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
94
107
|
# The HTTP Proxy server address as a string
|
95
108
|
# @return [String, nil]
|
96
109
|
def proxy_address
|
@@ -31,7 +31,7 @@ class PersistentHTTP::Pool < Vault::ConnectionPool # :nodoc:
|
|
31
31
|
stack = stacks[net_http_args]
|
32
32
|
|
33
33
|
if stack.empty? then
|
34
|
-
conn = @available.pop connection_args: net_http_args
|
34
|
+
conn = @available.pop @timeout, connection_args: net_http_args
|
35
35
|
else
|
36
36
|
conn = stack.last
|
37
37
|
end
|
data/lib/vault/persistent.rb
CHANGED
@@ -202,11 +202,6 @@ class PersistentHTTP
|
|
202
202
|
|
203
203
|
HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
|
204
204
|
|
205
|
-
##
|
206
|
-
# The default connection pool size is 1/4 the allowed open files.
|
207
|
-
|
208
|
-
DEFAULT_POOL_SIZE = 16
|
209
|
-
|
210
205
|
##
|
211
206
|
# The version of PersistentHTTP you are using
|
212
207
|
|
@@ -505,7 +500,7 @@ class PersistentHTTP
|
|
505
500
|
# Defaults to 1/4 the number of allowed file handles. You can have no more
|
506
501
|
# than this many threads with active HTTP transactions.
|
507
502
|
|
508
|
-
def initialize name=nil, proxy=nil, pool_size=DEFAULT_POOL_SIZE
|
503
|
+
def initialize name=nil, proxy=nil, pool_size=Vault::Defaults::DEFAULT_POOL_SIZE, pool_timeout=Vault::Defaults::DEFAULT_POOL_TIMEOUT
|
509
504
|
@name = name
|
510
505
|
|
511
506
|
@debug_output = nil
|
@@ -525,7 +520,7 @@ class PersistentHTTP
|
|
525
520
|
@socket_options << [Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1] if
|
526
521
|
Socket.const_defined? :TCP_NODELAY
|
527
522
|
|
528
|
-
@pool = PersistentHTTP::Pool.new size: pool_size do |http_args|
|
523
|
+
@pool = PersistentHTTP::Pool.new size: pool_size, timeout: pool_timeout do |http_args|
|
529
524
|
PersistentHTTP::Connection.new Net::HTTP, http_args, @ssl_generation
|
530
525
|
end
|
531
526
|
|
data/lib/vault/request.rb
CHANGED
data/lib/vault/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vault
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.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:
|
11
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sigv4
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2
|
33
|
+
version: '2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2
|
40
|
+
version: '2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,14 +115,9 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- ".circleci/config.yml"
|
119
|
-
- ".gitignore"
|
120
|
-
- ".rspec"
|
121
118
|
- CHANGELOG.md
|
122
|
-
- Gemfile
|
123
119
|
- LICENSE
|
124
120
|
- README.md
|
125
|
-
- Rakefile
|
126
121
|
- lib/vault.rb
|
127
122
|
- lib/vault/api.rb
|
128
123
|
- lib/vault/api/approle.rb
|
@@ -143,7 +138,13 @@ files:
|
|
143
138
|
- lib/vault/api/sys/mount.rb
|
144
139
|
- lib/vault/api/sys/namespace.rb
|
145
140
|
- lib/vault/api/sys/policy.rb
|
141
|
+
- lib/vault/api/sys/quota.rb
|
146
142
|
- lib/vault/api/sys/seal.rb
|
143
|
+
- lib/vault/api/transform.rb
|
144
|
+
- lib/vault/api/transform/alphabet.rb
|
145
|
+
- lib/vault/api/transform/role.rb
|
146
|
+
- lib/vault/api/transform/template.rb
|
147
|
+
- lib/vault/api/transform/transformation.rb
|
147
148
|
- lib/vault/client.rb
|
148
149
|
- lib/vault/configurable.rb
|
149
150
|
- lib/vault/defaults.rb
|
@@ -159,7 +160,6 @@ files:
|
|
159
160
|
- lib/vault/vendor/connection_pool/timed_stack.rb
|
160
161
|
- lib/vault/vendor/connection_pool/version.rb
|
161
162
|
- lib/vault/version.rb
|
162
|
-
- vault.gemspec
|
163
163
|
homepage: https://github.com/hashicorp/vault-ruby
|
164
164
|
licenses:
|
165
165
|
- MPL-2.0
|
@@ -172,14 +172,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
172
|
requirements:
|
173
173
|
- - ">="
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version: '0'
|
175
|
+
version: '2.0'
|
176
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
181
|
requirements: []
|
182
|
-
rubygems_version: 3.
|
182
|
+
rubygems_version: 3.2.3
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Vault is a Ruby API client for interacting with a Vault server.
|
data/.circleci/config.yml
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
version: 2.1
|
2
|
-
|
3
|
-
references:
|
4
|
-
images:
|
5
|
-
ubuntu: &UBUNTU_IMAGE ubuntu-1604:201903-01
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
test:
|
9
|
-
machine:
|
10
|
-
image: *UBUNTU_IMAGE
|
11
|
-
parameters:
|
12
|
-
ruby-version:
|
13
|
-
type: string
|
14
|
-
vault-version:
|
15
|
-
type: string
|
16
|
-
steps:
|
17
|
-
- checkout
|
18
|
-
- run:
|
19
|
-
name: Install vault
|
20
|
-
command: |
|
21
|
-
curl -sLo vault.zip https://releases.hashicorp.com/vault/<< parameters.vault-version >>/vault_<< parameters.vault-version >>_linux_amd64.zip
|
22
|
-
unzip vault.zip
|
23
|
-
mkdir -p ~/bin
|
24
|
-
mv vault ~/bin
|
25
|
-
export PATH="~/bin:$PATH"
|
26
|
-
- run:
|
27
|
-
name: Run tests
|
28
|
-
command: |
|
29
|
-
export VAULT_VERSION=<< parameters.vault-version >>
|
30
|
-
rvm use << parameters.ruby-version >> --install --binary --fuzzy
|
31
|
-
bundle install --jobs=3 --retry=3 --path=vendor/bundle
|
32
|
-
bundle exec rake
|
33
|
-
|
34
|
-
workflows:
|
35
|
-
run-tests:
|
36
|
-
jobs:
|
37
|
-
- test:
|
38
|
-
matrix:
|
39
|
-
parameters:
|
40
|
-
ruby-version: ["2.2", "2.3", "2.4"]
|
41
|
-
vault-version: ["1.0.3", "1.1.5", "1.2.4", "1.3.0"]
|
42
|
-
name: test-ruby-<< matrix.ruby-version >>-vault-<< matrix.vault-version >>
|
data/.gitignore
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
### Ruby ###
|
2
|
-
*.gem
|
3
|
-
*.rbc
|
4
|
-
/.config
|
5
|
-
/.vscode
|
6
|
-
/coverage/
|
7
|
-
/InstalledFiles
|
8
|
-
/pkg/
|
9
|
-
/spec/reports/
|
10
|
-
/test/tmp/
|
11
|
-
/test/version_tmp/
|
12
|
-
/tmp/
|
13
|
-
/vendor/bundle/
|
14
|
-
/vendor/ruby/
|
15
|
-
|
16
|
-
## Specific to RubyMotion:
|
17
|
-
.dat*
|
18
|
-
.repl_history
|
19
|
-
build/
|
20
|
-
|
21
|
-
## Documentation cache and generated files:
|
22
|
-
/.yardoc/
|
23
|
-
/_yardoc/
|
24
|
-
/doc/
|
25
|
-
/rdoc/
|
26
|
-
|
27
|
-
## Environment normalisation:
|
28
|
-
/.bundle/
|
29
|
-
/vendor/bundle
|
30
|
-
/lib/bundler/man/
|
31
|
-
|
32
|
-
# for a library or gem, you might want to ignore these files since the code is
|
33
|
-
# intended to run in multiple environments; otherwise, check them in:
|
34
|
-
Gemfile.lock
|
35
|
-
.ruby-version
|
36
|
-
.ruby-gemset
|
37
|
-
|
38
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
39
|
-
.rvmrc
|
40
|
-
|
41
|
-
# Project-specific
|
42
|
-
spec/tmp
|
data/.rspec
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/vault.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "vault/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "vault"
|
8
|
-
spec.version = Vault::VERSION
|
9
|
-
spec.authors = ["Seth Vargo"]
|
10
|
-
spec.email = ["sethvargo@gmail.com"]
|
11
|
-
spec.licenses = ["MPL-2.0"]
|
12
|
-
|
13
|
-
spec.summary = "Vault is a Ruby API client for interacting with a Vault server."
|
14
|
-
spec.description = spec.summary
|
15
|
-
spec.homepage = "https://github.com/hashicorp/vault-ruby"
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir = "exe"
|
19
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = ["lib"]
|
21
|
-
|
22
|
-
spec.add_runtime_dependency "aws-sigv4", "1.1.1"
|
23
|
-
|
24
|
-
spec.add_development_dependency "bundler", "~> 2.1.4"
|
25
|
-
spec.add_development_dependency "pry", "~> 0.13.1"
|
26
|
-
spec.add_development_dependency "rake", "~> 12.0"
|
27
|
-
spec.add_development_dependency "rspec", "~> 3.5"
|
28
|
-
spec.add_development_dependency "yard", "~> 0.9.24"
|
29
|
-
spec.add_development_dependency "webmock", "~> 3.8.3"
|
30
|
-
end
|