canzea 0.1.152 → 0.1.153
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canzea/version.rb +1 -1
- data/lib/registry.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20dfc1000c8c0ba659443d74d95e98a350a5fe57
|
4
|
+
data.tar.gz: ff5b570572a173017777e74e37dd983a4b954e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e7cea3321528d03fc324086f0ca2110f5fa806b0efc1f3412ceed788c65962320958f669efb863a81d469f3248f7066eebb2e5290bf0a1fab4fbb8ccacf2091
|
7
|
+
data.tar.gz: 66da930f5c35ab468669821dc3ba5aa8928958343ff28dca587f8c14f2694227ee54313154a4b5f8976d0d6541f7fa0e9403e77221ea992e31d98a4c55c4de2b
|
data/lib/canzea/version.rb
CHANGED
data/lib/registry.rb
CHANGED
@@ -117,6 +117,23 @@ class Registry
|
|
117
117
|
return JSON.parse(resp.body)['data']
|
118
118
|
end
|
119
119
|
|
120
|
+
def setVaultRecord (key, value)
|
121
|
+
|
122
|
+
uri = URI.parse(ENV["VAULT_URL"] + "/v1/#{key}")
|
123
|
+
http = prepareHttpForVault(uri)
|
124
|
+
|
125
|
+
request = Net::HTTP::Put.new(uri.request_uri)
|
126
|
+
request['Content-Type'] = 'application/json'
|
127
|
+
request['X-Vault-Token'] = ENV["VAULT_TOKEN"]
|
128
|
+
request.body = "#{value}";
|
129
|
+
resp = http.request(request)
|
130
|
+
|
131
|
+
if Integer(resp.code) != 204
|
132
|
+
puts "-- VAULT RECORD NOT SAVED! #{key}"
|
133
|
+
abort("Problem adding to vault, response code #{resp.code}")
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
120
137
|
def setSecret (key, value)
|
121
138
|
|
122
139
|
uri = URI.parse(ENV["VAULT_URL"] + "/v1/secret/#{key}")
|