confidante 0.28.0.pre.15 → 0.28.0.pre.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/confidante/version.rb +1 -1
- data/lib/hiera/backend/vault_backend.rb +20 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f3e97cd1b0dcd653425d0934a613a5a8228b0158fdc452686380daae3300e53
|
4
|
+
data.tar.gz: 9c71a804a9684722971e6fb83c08a850585abd4713c530bad399038b363bb4b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86540c8fdac3b8e870a11dcb34578ebadfb944532b879467f6c3750616d24420f86e8dd6a742e5b241fde95564537804f8f3da00570375d2ebd485752971f152
|
7
|
+
data.tar.gz: d3aa207302d69f104fc35e9e5dbd77d405237fa303ec4aa756d0bdb8f940a1877ece7855e2ea73a7995da811801dda191984325186d949560865beaad89ff86a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
confidante (0.28.0.pre.
|
4
|
+
confidante (0.28.0.pre.19)
|
5
5
|
activesupport (>= 4)
|
6
6
|
hiera (~> 3.3)
|
7
7
|
shikashi (~> 0.6)
|
@@ -113,7 +113,7 @@ GEM
|
|
113
113
|
diff-lcs (>= 1.2.0, < 2.0)
|
114
114
|
rspec-support (~> 3.11.0)
|
115
115
|
rspec-support (3.11.0)
|
116
|
-
rubocop (1.35.
|
116
|
+
rubocop (1.35.1)
|
117
117
|
json (~> 2.3)
|
118
118
|
parallel (~> 1.10)
|
119
119
|
parser (>= 3.1.2.1)
|
@@ -136,12 +136,12 @@ GEM
|
|
136
136
|
sexp_processor (~> 4.6)
|
137
137
|
ruby_gpg2 (0.8.0)
|
138
138
|
lino (>= 1.5)
|
139
|
-
ruby_parser (3.
|
139
|
+
ruby_parser (3.19.1)
|
140
140
|
sexp_processor (~> 4.16)
|
141
141
|
sawyer (0.8.2)
|
142
142
|
addressable (>= 2.3.5)
|
143
143
|
faraday (> 0.8, < 2.0)
|
144
|
-
sexp_processor (4.16.
|
144
|
+
sexp_processor (4.16.1)
|
145
145
|
shikashi (0.6.0)
|
146
146
|
evalhook (>= 0.6.0)
|
147
147
|
getsource (>= 0.1.0)
|
@@ -180,4 +180,4 @@ DEPENDENCIES
|
|
180
180
|
simplecov
|
181
181
|
|
182
182
|
BUNDLED WITH
|
183
|
-
2.3.
|
183
|
+
2.3.21
|
data/lib/confidante/version.rb
CHANGED
@@ -17,24 +17,34 @@ class Hiera
|
|
17
17
|
|
18
18
|
vault_config = Backend.parse_answer(Config[:vault], scope)
|
19
19
|
vault_address = vault_config[:address]
|
20
|
-
vault_client = Vault::Client.new(address: vault_address)
|
21
20
|
|
22
|
-
|
21
|
+
throw :no_vault_address_provided unless vault_address
|
23
22
|
|
24
|
-
|
23
|
+
vault_client = Vault::Client.new(address: vault_address)
|
24
|
+
value = get_value(vault_client, key, vault_config[:sources])
|
25
|
+
Backend.parse_answer(value, scope)
|
26
|
+
end
|
25
27
|
|
26
|
-
|
28
|
+
def get_value(vault_client, key, sources)
|
29
|
+
found_source = sources.find do |source|
|
30
|
+
read_kv_value(vault_client, source, key)
|
31
|
+
end
|
27
32
|
|
28
|
-
|
33
|
+
throw(:no_such_key) unless found_source
|
34
|
+
|
35
|
+
read_kv_value(vault_client, found_source, key)
|
29
36
|
end
|
30
37
|
|
31
38
|
def read_kv_value(vault_client, source, key)
|
32
|
-
|
33
|
-
|
39
|
+
throw(:unsupported_secrets_engine) unless source[:engine] == 'kv'
|
40
|
+
|
41
|
+
mount = source[:mount]
|
42
|
+
full_path = "#{source[:path]}/#{key}"
|
43
|
+
|
44
|
+
secret = vault_client.kv(mount).read(full_path)
|
45
|
+
return nil unless secret
|
34
46
|
|
35
|
-
|
36
|
-
throw(:no_such_key) unless value
|
37
|
-
value
|
47
|
+
secret.data[:value]
|
38
48
|
end
|
39
49
|
end
|
40
50
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confidante
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.28.0.pre.
|
4
|
+
version: 0.28.0.pre.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InfraBlocks Maintainers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|