rubyconfig-vault 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/vault/vault_source.rb +11 -2
- data/lib/config/vault/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63279ad2f29fabd8006dd8bdf3a69e49dabd2a1d5e3f89c1c695c9e6528f5154
|
4
|
+
data.tar.gz: 734327aae2db0747633a5a06101e2c2117ad54b0b441011bf4d58348da871c46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b6aac24bcb3781bae89ef0bc3e77fe5da3f5ada28308c711e5f8117e193cedcf12aaf5a6576ab080521f138325052c16c5e2246011fb086b38c7407cd32a839
|
7
|
+
data.tar.gz: 8455068a25f114a7a9a430e8daf25421c253f39788c673bcfd996ba208bfee086f7c5fb7d3dfd0c2f93c7349eb6792d4851b082c0753b60ebf729c04db2f2379
|
@@ -27,6 +27,7 @@ module Config
|
|
27
27
|
@root = client_opts.delete(:root)
|
28
28
|
@flatten = client_opts.delete(:flatten)
|
29
29
|
@paths << client_opts.delete(:paths) if client_opts.key?(:paths)
|
30
|
+
@map = {}
|
30
31
|
@paths.map! do |p|
|
31
32
|
if p.is_a?(Array)
|
32
33
|
p
|
@@ -50,6 +51,13 @@ module Config
|
|
50
51
|
@paths << [path, root]
|
51
52
|
end
|
52
53
|
|
54
|
+
# Re-map individual key names
|
55
|
+
#
|
56
|
+
# @param hsh [Hash] mappings for keys
|
57
|
+
def map(hsh)
|
58
|
+
@map = hsh
|
59
|
+
end
|
60
|
+
|
53
61
|
# Remove added paths
|
54
62
|
def clear_paths
|
55
63
|
@paths = []
|
@@ -95,8 +103,9 @@ module Config
|
|
95
103
|
query_path, idx, parent = stack.pop
|
96
104
|
sp = subpaths[idx]
|
97
105
|
if sp.nil? || sp.eql?('*')
|
98
|
-
data = client_ops.read(query_path)&.data
|
99
|
-
parent.merge!(data
|
106
|
+
data = client_ops.read(query_path)&.data || {}
|
107
|
+
parent.merge!(data)
|
108
|
+
parent.transform_keys! { |key| @map[key] || key }
|
100
109
|
parent.compact!
|
101
110
|
end
|
102
111
|
|
data/lib/config/vault/version.rb
CHANGED