vault 0.19.0 → 0.20.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -1
- data/README.md +115 -12
- data/lib/vault/api/approle.rb +27 -14
- data/lib/vault/api/auth.rb +16 -4
- data/lib/vault/api/auth_tls.rb +1 -1
- data/lib/vault/api/auth_token.rb +1 -1
- data/lib/vault/api/help.rb +1 -1
- data/lib/vault/api/kv.rb +1 -1
- data/lib/vault/api/logical.rb +2 -1
- data/lib/vault/api/secret.rb +1 -1
- data/lib/vault/api/sys/audit.rb +1 -1
- data/lib/vault/api/sys/auth.rb +1 -1
- data/lib/vault/api/sys/health.rb +1 -1
- data/lib/vault/api/sys/init.rb +1 -1
- data/lib/vault/api/sys/leader.rb +7 -2
- data/lib/vault/api/sys/lease.rb +1 -1
- data/lib/vault/api/sys/mount.rb +1 -1
- data/lib/vault/api/sys/namespace.rb +1 -1
- data/lib/vault/api/sys/policy.rb +1 -1
- data/lib/vault/api/sys/quota.rb +1 -1
- data/lib/vault/api/sys/seal.rb +1 -1
- data/lib/vault/api/sys.rb +1 -1
- data/lib/vault/api/transform/alphabet.rb +1 -1
- data/lib/vault/api/transform/role.rb +1 -1
- data/lib/vault/api/transform/template.rb +1 -1
- data/lib/vault/api/transform/transformation.rb +1 -1
- data/lib/vault/api/transform.rb +1 -1
- data/lib/vault/api.rb +1 -1
- data/lib/vault/client.rb +1 -1
- data/lib/vault/configurable.rb +1 -1
- data/lib/vault/defaults.rb +1 -1
- data/lib/vault/encode.rb +2 -2
- data/lib/vault/errors.rb +1 -1
- data/lib/vault/request.rb +1 -1
- data/lib/vault/response.rb +1 -1
- data/lib/vault/version.rb +2 -2
- data/lib/vault.rb +1 -10
- metadata +2 -100
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c86a7bae231cd9c95b9e43bbb61640fe6fe29a30cace67d03d27ffc96de7e6c8
|
|
4
|
+
data.tar.gz: 3f4a0cd1294c8c6ac4f5224b4561b9db921d93ba2ea1084c4efcc070ea34f44e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c288f3b0fa1f7ee0e9c7b8143bb2dfd168d8b55d39fe86846a157637fc0d2ddbeda2c0a21671fa9572bf7d61be9d29adef10c353eed62d97e706131f662f1819
|
|
7
|
+
data.tar.gz: 41fe6e37b5fc42b4d2aa3834a9ce985eab915cd0a92d6e6e0f4f7cf623d32e229dba51f37d5a5ff300625fcf5bc7ff6502b4e5cf682cafd6556a5b1f577649cd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Vault Ruby Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## v0.20.0 (February 4, 2026)
|
|
4
|
+
|
|
5
|
+
IMPROVEMENTS
|
|
6
|
+
|
|
7
|
+
- Added `cluster_address` field to `LeaderStatus` response from `sys/leader` endpoint [GH-204]
|
|
8
|
+
- Updated AppRole `set_role` documentation to include modern parameters like `secret_id_bound_cidrs`, `token_bound_cidrs`, and `token_policies`. Added reference to official Vault API docs for complete parameter list. [GH-220]
|
|
9
|
+
- Added support for custom mount paths in AppRole authentication via `mount:` option [GH-292]
|
|
10
|
+
|
|
11
|
+
BUG FIXES
|
|
12
|
+
|
|
13
|
+
- Fixed `encode_path` incorrectly encoding hyphens (`-`), which caused 403 errors on Vault 1.15+ [GH-350, GH-343]
|
|
14
|
+
- Fixed `FrozenError` when loading the gem with OpenSSL 4.0.0+ by removing modification of `OpenSSL::SSL::SSLContext::DEFAULT_PARAMS`. Modern Ruby (3.1+) already has secure SSL defaults. [GH-366, GH-381]
|
|
15
|
+
- Fixed `Vault.logical.read` throwing `NoMethodError` when Vault responds with HTTP 204 (No Content). Now correctly returns `nil` for empty responses. [GH-241]
|
|
4
16
|
|
|
5
17
|
## v0.19.0 (December 3, 2025)
|
|
6
18
|
|
|
@@ -27,6 +39,12 @@ BUG FIXES
|
|
|
27
39
|
|
|
28
40
|
- Fixed HTTP client shutdown to be lock-protected, ensuring thread-safe access to `@nhp` [GH-329]
|
|
29
41
|
|
|
42
|
+
## v0.18.2 (November 27, 2023)
|
|
43
|
+
|
|
44
|
+
BUG FIXES
|
|
45
|
+
|
|
46
|
+
- Locked aws-sdk gem versions to support EOL Ruby versions [GH-314]
|
|
47
|
+
|
|
30
48
|
## v0.18.1 (September 14, 2023)
|
|
31
49
|
|
|
32
50
|
BUG FIXES
|
data/README.md
CHANGED
|
@@ -63,9 +63,27 @@ Vault.configure do |config|
|
|
|
63
63
|
# ENV["VAULT_SSL_PEM_CONTENTS_BASE64"] then ENV["VAULT_SSL_PEM_CONTENTS"]
|
|
64
64
|
config.ssl_pem_contents = "-----BEGIN ENCRYPTED..."
|
|
65
65
|
|
|
66
|
+
# Passphrase for encrypted PEM files
|
|
67
|
+
config.ssl_pem_passphrase = "my-passphrase"
|
|
68
|
+
|
|
69
|
+
# Custom SSL CA certificate for verification
|
|
70
|
+
config.ssl_ca_cert = "/path/to/ca.crt"
|
|
71
|
+
|
|
72
|
+
# Custom SSL CA certificate directory
|
|
73
|
+
config.ssl_ca_path = "/path/to/ca/directory"
|
|
74
|
+
|
|
75
|
+
# Custom SSL certificate store
|
|
76
|
+
config.ssl_cert_store = OpenSSL::X509::Store.new
|
|
77
|
+
|
|
78
|
+
# Specify SSL ciphers to use
|
|
79
|
+
config.ssl_ciphers = "TLSv1.2:!aNULL:!eNULL"
|
|
80
|
+
|
|
66
81
|
# Use SSL verification, also read as ENV["VAULT_SSL_VERIFY"]
|
|
67
82
|
config.ssl_verify = false
|
|
68
83
|
|
|
84
|
+
# SNI hostname to use for SSL connections
|
|
85
|
+
config.hostname = "vault.example.com"
|
|
86
|
+
|
|
69
87
|
# Timeout the connection after a certain amount of time (seconds), also read
|
|
70
88
|
# as ENV["VAULT_TIMEOUT"]
|
|
71
89
|
config.timeout = 30
|
|
@@ -75,6 +93,10 @@ Vault.configure do |config|
|
|
|
75
93
|
config.ssl_timeout = 5
|
|
76
94
|
config.open_timeout = 5
|
|
77
95
|
config.read_timeout = 30
|
|
96
|
+
|
|
97
|
+
# Connection pool settings for persistent connections
|
|
98
|
+
config.pool_size = 5
|
|
99
|
+
config.pool_timeout = 5
|
|
78
100
|
end
|
|
79
101
|
```
|
|
80
102
|
|
|
@@ -85,6 +107,27 @@ client_1 = Vault::Client.new(address: "https://vault.mycompany.com")
|
|
|
85
107
|
client_2 = Vault::Client.new(address: "https://other-vault.mycompany.com")
|
|
86
108
|
```
|
|
87
109
|
|
|
110
|
+
### Authentication
|
|
111
|
+
|
|
112
|
+
Authenticate using various methods:
|
|
113
|
+
|
|
114
|
+
```ruby
|
|
115
|
+
# LDAP
|
|
116
|
+
Vault.auth.ldap("username", "password")
|
|
117
|
+
|
|
118
|
+
# Username/Password
|
|
119
|
+
Vault.auth.userpass("username", "password")
|
|
120
|
+
|
|
121
|
+
# AppRole
|
|
122
|
+
Vault.auth.approle("role_id", "secret_id")
|
|
123
|
+
|
|
124
|
+
# GitHub token
|
|
125
|
+
Vault.auth.github("github_token")
|
|
126
|
+
|
|
127
|
+
# AWS IAM
|
|
128
|
+
Vault.auth.aws_iam("role_name", credentials_provider, "header_value")
|
|
129
|
+
```
|
|
130
|
+
|
|
88
131
|
And if you want to authenticate with a `AWS EC2` :
|
|
89
132
|
|
|
90
133
|
```ruby
|
|
@@ -156,28 +199,73 @@ Vault.with_retries(Exception) do
|
|
|
156
199
|
end #=> #<Exception>
|
|
157
200
|
```
|
|
158
201
|
|
|
159
|
-
|
|
202
|
+
### KV Secrets Engine
|
|
203
|
+
|
|
204
|
+
Vault's [KV secrets engine](https://developer.hashicorp.com/vault/docs/secrets/kv) has two versions: [v2](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2) (versioned, default in Vault 0.10+) and [v1](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v1) (unversioned). Use `Vault.kv(mount)` for v2 and `Vault.logical` for v1.
|
|
205
|
+
|
|
160
206
|
```ruby
|
|
161
|
-
|
|
162
|
-
|
|
207
|
+
# Check which version your mount uses
|
|
208
|
+
mounts = Vault.sys.mounts
|
|
209
|
+
mounts[:secret].options[:version] #=> "2" or "1"
|
|
163
210
|
```
|
|
164
211
|
|
|
165
|
-
####
|
|
212
|
+
#### KV v2 (versioned secrets)
|
|
213
|
+
|
|
166
214
|
```ruby
|
|
167
|
-
|
|
168
|
-
|
|
215
|
+
# Write and read
|
|
216
|
+
Vault.kv("secret").write("db/creds", username: "admin", password: "secret123")
|
|
217
|
+
secret = Vault.kv("secret").read("db/creds")
|
|
218
|
+
secret.data[:data] #=> { :username => "admin", :password => "secret123" }
|
|
219
|
+
|
|
220
|
+
# Read specific version
|
|
221
|
+
secret = Vault.kv("secret").read("db/creds", 2)
|
|
222
|
+
|
|
223
|
+
# List paths
|
|
224
|
+
Vault.kv("secret").list("db") #=> ["creds"]
|
|
225
|
+
|
|
226
|
+
# Soft delete (can be undeleted)
|
|
227
|
+
Vault.kv("secret").delete("db/creds")
|
|
228
|
+
Vault.kv("secret").delete_versions("db/creds", [1, 2])
|
|
229
|
+
|
|
230
|
+
# Undelete
|
|
231
|
+
Vault.kv("secret").undelete_versions("db/creds", [1])
|
|
232
|
+
|
|
233
|
+
# Permanently destroy
|
|
234
|
+
Vault.kv("secret").destroy_versions("db/creds", [1])
|
|
235
|
+
Vault.kv("secret").destroy("db/creds") # destroys all versions and metadata
|
|
236
|
+
|
|
237
|
+
# Metadata operations
|
|
238
|
+
Vault.kv("secret").write_metadata("db/creds", max_versions: 5)
|
|
239
|
+
metadata = Vault.kv("secret").read_metadata("db/creds")
|
|
169
240
|
```
|
|
170
241
|
|
|
171
|
-
####
|
|
242
|
+
#### KV v1 (unversioned secrets)
|
|
243
|
+
|
|
172
244
|
```ruby
|
|
173
|
-
Vault.logical.
|
|
174
|
-
|
|
245
|
+
Vault.logical.write("secret/db/creds", username: "admin", password: "secret123")
|
|
246
|
+
secret = Vault.logical.read("secret/db/creds")
|
|
247
|
+
secret.data #=> { :username => "admin", :password => "secret123" }
|
|
248
|
+
|
|
249
|
+
Vault.logical.list("secret/db") #=> ["creds"]
|
|
250
|
+
Vault.logical.delete("secret/db/creds") #=> true
|
|
175
251
|
```
|
|
176
252
|
|
|
177
|
-
####
|
|
253
|
+
#### Seal Status
|
|
178
254
|
```ruby
|
|
179
|
-
|
|
180
|
-
|
|
255
|
+
Vault.sys.seal_status
|
|
256
|
+
#=> #<Vault::SealStatus sealed=false, t=1, n=1, progress=0>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Tokens
|
|
260
|
+
|
|
261
|
+
See the [Token Auth API docs](https://developer.hashicorp.com/vault/api-docs/auth/token) for details.
|
|
262
|
+
|
|
263
|
+
```ruby
|
|
264
|
+
# Create, lookup, renew, and revoke
|
|
265
|
+
token = Vault.auth_token.create(policies: ["app-read"], ttl: "1h", renewable: true)
|
|
266
|
+
info = Vault.auth_token.lookup_self
|
|
267
|
+
Vault.auth_token.renew_self(3600)
|
|
268
|
+
Vault.auth_token.revoke("hvs.CAESI...")
|
|
181
269
|
```
|
|
182
270
|
|
|
183
271
|
### Response wrapping
|
|
@@ -206,6 +294,21 @@ wrapped = Vault.auth_token.create(wrap_ttl: "5s")
|
|
|
206
294
|
token = Vault.logical.unwrap_token(wrapped)
|
|
207
295
|
```
|
|
208
296
|
|
|
297
|
+
### API Coverage
|
|
298
|
+
|
|
299
|
+
Available Ruby clients:
|
|
300
|
+
|
|
301
|
+
- `Vault.kv(mount)` - [KV v2 secrets engine](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2)
|
|
302
|
+
- `Vault.logical` - [KV v1](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v1) and generic logical operations
|
|
303
|
+
- `Vault.sys` - [System backend](https://developer.hashicorp.com/vault/api-docs/system) (mounts, policies, seal status, etc.)
|
|
304
|
+
- `Vault.auth` - [Authentication methods](https://developer.hashicorp.com/vault/api-docs/auth) (AWS, AppRole, GitHub, etc.)
|
|
305
|
+
- `Vault.auth_token` - [Token auth](https://developer.hashicorp.com/vault/api-docs/auth/token)
|
|
306
|
+
- `Vault.approle` - [AppRole auth configuration](https://developer.hashicorp.com/vault/api-docs/auth/approle)
|
|
307
|
+
- `Vault.transform` - [Transform secrets engine](https://developer.hashicorp.com/vault/api-docs/secret/transform)
|
|
308
|
+
- `Vault.help` - Interactive help
|
|
309
|
+
|
|
310
|
+
For full API documentation, see [rubydoc.info/gems/vault](https://www.rubydoc.info/gems/vault) or check `spec/integration` for examples
|
|
311
|
+
|
|
209
312
|
|
|
210
313
|
Development
|
|
211
314
|
-----------
|
data/lib/vault/api/approle.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright IBM Corp. 2015, 2025
|
|
2
2
|
# SPDX-License-Identifier: MPL-2.0
|
|
3
3
|
|
|
4
4
|
require "json"
|
|
@@ -24,9 +24,10 @@ module Vault
|
|
|
24
24
|
# @example
|
|
25
25
|
# Vault.approle.set_role("testrole", {
|
|
26
26
|
# secret_id_ttl: "10m",
|
|
27
|
+
# secret_id_bound_cidrs: ["10.0.0.0/8"],
|
|
27
28
|
# token_ttl: "20m",
|
|
28
|
-
#
|
|
29
|
-
#
|
|
29
|
+
# token_policies: ["default", "app-policy"],
|
|
30
|
+
# token_bound_cidrs: ["10.0.0.0/8"],
|
|
30
31
|
# }) #=> true
|
|
31
32
|
#
|
|
32
33
|
# @param [String] name
|
|
@@ -34,29 +35,41 @@ module Vault
|
|
|
34
35
|
# @param [Hash] options
|
|
35
36
|
# @option options [Boolean] :bind_secret_id
|
|
36
37
|
# Require secret_id to be presented when logging in using this AppRole.
|
|
37
|
-
# @option options [String] :
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
# @option options [String] :policies
|
|
41
|
-
# Comma-separated list of policies set on tokens issued via this AppRole.
|
|
38
|
+
# @option options [Array<String>] :secret_id_bound_cidrs
|
|
39
|
+
# Array of CIDR blocks. If set, specifies blocks of IP addresses which
|
|
40
|
+
# can perform the login operation.
|
|
42
41
|
# @option options [String] :secret_id_num_uses
|
|
43
42
|
# Number of times any particular SecretID can be used to fetch a token
|
|
44
43
|
# from this AppRole, after which the SecretID will expire.
|
|
45
44
|
# @option options [Fixnum, String] :secret_id_ttl
|
|
46
45
|
# The number of seconds or a golang-formatted timestamp like "60m" after
|
|
47
46
|
# which any SecretID expires.
|
|
47
|
+
# @option options [Boolean] :local_secret_ids
|
|
48
|
+
# If set, the secret IDs generated using this role will be cluster local.
|
|
49
|
+
# @option options [Array<String>] :token_policies
|
|
50
|
+
# Array of policies to be set on tokens issued using this AppRole.
|
|
51
|
+
# @option options [Array<String>] :token_bound_cidrs
|
|
52
|
+
# Array of CIDR blocks. If set, specifies blocks of IP addresses which
|
|
53
|
+
# can authenticate using tokens generated by this AppRole.
|
|
48
54
|
# @option options [Fixnum, String] :token_ttl
|
|
49
55
|
# The number of seconds or a golang-formatted timestamp like "60m" to set
|
|
50
56
|
# as the TTL for issued tokens and at renewal time.
|
|
51
57
|
# @option options [Fixnum, String] :token_max_ttl
|
|
52
58
|
# The number of seconds or a golang-formatted timestamp like "60m" after
|
|
53
59
|
# which the issued token can no longer be renewed.
|
|
54
|
-
# @option options [Fixnum, String] :
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
#
|
|
60
|
+
# @option options [Fixnum, String] :token_explicit_max_ttl
|
|
61
|
+
# If set, tokens created via this role carry an explicit maximum TTL.
|
|
62
|
+
# @option options [Boolean] :token_no_default_policy
|
|
63
|
+
# If set, the default policy will not be set on tokens issued via this role.
|
|
64
|
+
# @option options [Fixnum] :token_num_uses
|
|
65
|
+
# The maximum number of times a generated token may be used.
|
|
66
|
+
# @option options [Fixnum, String] :token_period
|
|
67
|
+
# The maximum allowed period value when a periodic token is requested.
|
|
68
|
+
# @option options [String] :token_type
|
|
69
|
+
# The type of token that should be generated (service, batch, or default).
|
|
70
|
+
#
|
|
71
|
+
# For a complete list of parameters, see the Vault AppRole API documentation:
|
|
72
|
+
# https://developer.hashicorp.com/vault/api-docs/auth/approle
|
|
60
73
|
#
|
|
61
74
|
# @return [true]
|
|
62
75
|
def set_role(name, options = {})
|
data/lib/vault/api/auth.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright IBM Corp. 2015, 2025
|
|
2
2
|
# SPDX-License-Identifier: MPL-2.0
|
|
3
3
|
|
|
4
4
|
require "json"
|
|
@@ -81,21 +81,32 @@ module Vault
|
|
|
81
81
|
# successful, the resulting token will be stored on the client and used for
|
|
82
82
|
# future requests.
|
|
83
83
|
#
|
|
84
|
-
# @example
|
|
84
|
+
# @example Default mount point
|
|
85
85
|
# Vault.auth.approle(
|
|
86
86
|
# "db02de05-fa39-4855-059b-67221c5c2f63",
|
|
87
87
|
# "6a174c20-f6de-a53c-74d2-6018fcceff64",
|
|
88
88
|
# ) #=> #<Vault::Secret lease_id="">
|
|
89
89
|
#
|
|
90
|
+
# @example Custom mount point
|
|
91
|
+
# Vault.auth.approle(
|
|
92
|
+
# "db02de05-fa39-4855-059b-67221c5c2f63",
|
|
93
|
+
# "6a174c20-f6de-a53c-74d2-6018fcceff64",
|
|
94
|
+
# mount: "my-approle"
|
|
95
|
+
# ) #=> #<Vault::Secret lease_id="">
|
|
96
|
+
#
|
|
90
97
|
# @param [String] role_id
|
|
91
98
|
# @param [String] secret_id (default: nil)
|
|
92
99
|
# It is required when `bind_secret_id` is enabled for the specified role_id
|
|
100
|
+
# @param [Hash] options
|
|
101
|
+
# @option options [String] :mount (default: "approle")
|
|
102
|
+
# The path where the approle auth backend is mounted
|
|
93
103
|
#
|
|
94
104
|
# @return [Secret]
|
|
95
|
-
def approle(role_id, secret_id=nil)
|
|
105
|
+
def approle(role_id, secret_id=nil, options = {})
|
|
106
|
+
mount = options[:mount] || 'approle'
|
|
96
107
|
payload = { role_id: role_id }
|
|
97
108
|
payload[:secret_id] = secret_id if secret_id
|
|
98
|
-
json = client.post("/v1/auth/
|
|
109
|
+
json = client.post("/v1/auth/#{CGI.escape(mount)}/login", JSON.generate(payload))
|
|
99
110
|
secret = Secret.decode(json)
|
|
100
111
|
client.token = secret.auth.client_token
|
|
101
112
|
return secret
|
|
@@ -206,6 +217,7 @@ module Vault
|
|
|
206
217
|
# @param [String] sts_endpoint optional
|
|
207
218
|
# https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html
|
|
208
219
|
# @param [String] route optional
|
|
220
|
+
# The full api path to the auth method's login endpoint, ie `/v1/auth/aws/mycorp/myorg/login`
|
|
209
221
|
# @return [Secret]
|
|
210
222
|
def aws_iam(role, credentials_provider, iam_auth_header_value = nil, sts_endpoint = 'https://sts.amazonaws.com', route = nil)
|
|
211
223
|
require "aws-sigv4"
|
data/lib/vault/api/auth_tls.rb
CHANGED
data/lib/vault/api/auth_token.rb
CHANGED
data/lib/vault/api/help.rb
CHANGED
data/lib/vault/api/kv.rb
CHANGED
data/lib/vault/api/logical.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright IBM Corp. 2015, 2025
|
|
2
2
|
# SPDX-License-Identifier: MPL-2.0
|
|
3
3
|
|
|
4
4
|
require_relative "secret"
|
|
@@ -48,6 +48,7 @@ module Vault
|
|
|
48
48
|
def read(path, options = {})
|
|
49
49
|
headers = extract_headers!(options)
|
|
50
50
|
json = client.get("/v1/#{encode_path(path)}", {}, headers)
|
|
51
|
+
return nil if json.nil?
|
|
51
52
|
return Secret.decode(json)
|
|
52
53
|
rescue HTTPError => e
|
|
53
54
|
return nil if e.code == 404
|
data/lib/vault/api/secret.rb
CHANGED
data/lib/vault/api/sys/audit.rb
CHANGED
data/lib/vault/api/sys/auth.rb
CHANGED
data/lib/vault/api/sys/health.rb
CHANGED
data/lib/vault/api/sys/init.rb
CHANGED
data/lib/vault/api/sys/leader.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright IBM Corp. 2015, 2025
|
|
2
2
|
# SPDX-License-Identifier: MPL-2.0
|
|
3
3
|
|
|
4
4
|
module Vault
|
|
@@ -18,6 +18,11 @@ module Vault
|
|
|
18
18
|
# @return [String]
|
|
19
19
|
field :leader_address, as: :address
|
|
20
20
|
|
|
21
|
+
# @!attribute [r] cluster_address
|
|
22
|
+
# URL where the cluster leader is running.
|
|
23
|
+
# @return [String]
|
|
24
|
+
field :leader_cluster_address, as: :cluster_address
|
|
25
|
+
|
|
21
26
|
# @deprecated Use {#ha_enabled?} instead
|
|
22
27
|
def ha?; ha_enabled?; end
|
|
23
28
|
|
|
@@ -35,7 +40,7 @@ module Vault
|
|
|
35
40
|
# Determine the leader status for this vault.
|
|
36
41
|
#
|
|
37
42
|
# @example
|
|
38
|
-
# Vault.sys.leader #=> #<Vault::LeaderStatus ha_enabled=false, is_self=false, leader_address="">
|
|
43
|
+
# Vault.sys.leader #=> #<Vault::LeaderStatus ha_enabled=false, is_self=false, leader_address="", leader_cluster_address="">
|
|
39
44
|
#
|
|
40
45
|
# @return [LeaderStatus]
|
|
41
46
|
def leader
|
data/lib/vault/api/sys/lease.rb
CHANGED
data/lib/vault/api/sys/mount.rb
CHANGED
data/lib/vault/api/sys/policy.rb
CHANGED
data/lib/vault/api/sys/quota.rb
CHANGED
data/lib/vault/api/sys/seal.rb
CHANGED
data/lib/vault/api/sys.rb
CHANGED
data/lib/vault/api/transform.rb
CHANGED
data/lib/vault/api.rb
CHANGED
data/lib/vault/client.rb
CHANGED
data/lib/vault/configurable.rb
CHANGED
data/lib/vault/defaults.rb
CHANGED
data/lib/vault/encode.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright IBM Corp. 2015, 2025
|
|
2
2
|
# SPDX-License-Identifier: MPL-2.0
|
|
3
3
|
|
|
4
4
|
module Vault
|
|
@@ -12,7 +12,7 @@ module Vault
|
|
|
12
12
|
#
|
|
13
13
|
# @return [String]
|
|
14
14
|
def encode_path(path)
|
|
15
|
-
path.b.gsub(%r!([^a-zA-Z0-9_
|
|
15
|
+
path.b.gsub(%r!([^a-zA-Z0-9_.\-/]+)!) { |m|
|
|
16
16
|
'%' + m.unpack('H2' * m.bytesize).join('%').upcase
|
|
17
17
|
}
|
|
18
18
|
end
|
data/lib/vault/errors.rb
CHANGED
data/lib/vault/request.rb
CHANGED
data/lib/vault/response.rb
CHANGED
data/lib/vault/version.rb
CHANGED
data/lib/vault.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright IBM Corp. 2015, 2025
|
|
2
2
|
# SPDX-License-Identifier: MPL-2.0
|
|
3
3
|
|
|
4
4
|
module Vault
|
|
@@ -20,15 +20,6 @@ module Vault
|
|
|
20
20
|
def setup!
|
|
21
21
|
@client = Vault::Client.new
|
|
22
22
|
|
|
23
|
-
# Set secure SSL options
|
|
24
|
-
OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.tap do |opts|
|
|
25
|
-
opts[:options] &= ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS if defined?(OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS)
|
|
26
|
-
opts[:options] |= OpenSSL::SSL::OP_NO_COMPRESSION if defined?(OpenSSL::SSL::OP_NO_COMPRESSION)
|
|
27
|
-
opts[:options] |= OpenSSL::SSL::OP_NO_SSLv2 if defined?(OpenSSL::SSL::OP_NO_SSLv2)
|
|
28
|
-
opts[:options] |= OpenSSL::SSL::OP_NO_SSLv3 if defined?(OpenSSL::SSL::OP_NO_SSLv3)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
|
|
32
23
|
self
|
|
33
24
|
end
|
|
34
25
|
|
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.
|
|
4
|
+
version: 0.20.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: 2026-02-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sigv4
|
|
@@ -72,104 +72,6 @@ dependencies:
|
|
|
72
72
|
- - ">="
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
74
|
version: 4.0.2
|
|
75
|
-
- !ruby/object:Gem::Dependency
|
|
76
|
-
name: bundler
|
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
|
78
|
-
requirements:
|
|
79
|
-
- - "~>"
|
|
80
|
-
- !ruby/object:Gem::Version
|
|
81
|
-
version: '2'
|
|
82
|
-
type: :development
|
|
83
|
-
prerelease: false
|
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
85
|
-
requirements:
|
|
86
|
-
- - "~>"
|
|
87
|
-
- !ruby/object:Gem::Version
|
|
88
|
-
version: '2'
|
|
89
|
-
- !ruby/object:Gem::Dependency
|
|
90
|
-
name: pry
|
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
|
92
|
-
requirements:
|
|
93
|
-
- - "~>"
|
|
94
|
-
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.13.1
|
|
96
|
-
type: :development
|
|
97
|
-
prerelease: false
|
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
99
|
-
requirements:
|
|
100
|
-
- - "~>"
|
|
101
|
-
- !ruby/object:Gem::Version
|
|
102
|
-
version: 0.13.1
|
|
103
|
-
- !ruby/object:Gem::Dependency
|
|
104
|
-
name: rake
|
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
|
106
|
-
requirements:
|
|
107
|
-
- - "~>"
|
|
108
|
-
- !ruby/object:Gem::Version
|
|
109
|
-
version: '12.0'
|
|
110
|
-
type: :development
|
|
111
|
-
prerelease: false
|
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
113
|
-
requirements:
|
|
114
|
-
- - "~>"
|
|
115
|
-
- !ruby/object:Gem::Version
|
|
116
|
-
version: '12.0'
|
|
117
|
-
- !ruby/object:Gem::Dependency
|
|
118
|
-
name: rspec
|
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
|
120
|
-
requirements:
|
|
121
|
-
- - "~>"
|
|
122
|
-
- !ruby/object:Gem::Version
|
|
123
|
-
version: '3.5'
|
|
124
|
-
type: :development
|
|
125
|
-
prerelease: false
|
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
127
|
-
requirements:
|
|
128
|
-
- - "~>"
|
|
129
|
-
- !ruby/object:Gem::Version
|
|
130
|
-
version: '3.5'
|
|
131
|
-
- !ruby/object:Gem::Dependency
|
|
132
|
-
name: yard
|
|
133
|
-
requirement: !ruby/object:Gem::Requirement
|
|
134
|
-
requirements:
|
|
135
|
-
- - "~>"
|
|
136
|
-
- !ruby/object:Gem::Version
|
|
137
|
-
version: 0.9.24
|
|
138
|
-
type: :development
|
|
139
|
-
prerelease: false
|
|
140
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
141
|
-
requirements:
|
|
142
|
-
- - "~>"
|
|
143
|
-
- !ruby/object:Gem::Version
|
|
144
|
-
version: 0.9.24
|
|
145
|
-
- !ruby/object:Gem::Dependency
|
|
146
|
-
name: webmock
|
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
|
148
|
-
requirements:
|
|
149
|
-
- - "~>"
|
|
150
|
-
- !ruby/object:Gem::Version
|
|
151
|
-
version: 3.8.3
|
|
152
|
-
type: :development
|
|
153
|
-
prerelease: false
|
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
155
|
-
requirements:
|
|
156
|
-
- - "~>"
|
|
157
|
-
- !ruby/object:Gem::Version
|
|
158
|
-
version: 3.8.3
|
|
159
|
-
- !ruby/object:Gem::Dependency
|
|
160
|
-
name: webrick
|
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
|
162
|
-
requirements:
|
|
163
|
-
- - "~>"
|
|
164
|
-
- !ruby/object:Gem::Version
|
|
165
|
-
version: '1.5'
|
|
166
|
-
type: :development
|
|
167
|
-
prerelease: false
|
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
169
|
-
requirements:
|
|
170
|
-
- - "~>"
|
|
171
|
-
- !ruby/object:Gem::Version
|
|
172
|
-
version: '1.5'
|
|
173
75
|
description: Vault is a Ruby API client for interacting with a Vault server.
|
|
174
76
|
email:
|
|
175
77
|
- team-vault-devex@hashicorp.com
|