muchkeys 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/circle.yml +10 -0
- data/lib/muchkeys/version.rb +1 -1
- data/lib/muchkeys.rb +8 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ad2ab8e2bfa75fd797b36be39c1a8184ce7484e
|
4
|
+
data.tar.gz: 3f21dc427fb84b6f2d7b23238e1200d5578620bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c72caa89877fb1e9b091efe521b45378fb7b5da1ae6133e4f976252b398d2a54e0a7afda1cbe6cf0c8f8b8215eab4e0ab84fc86e527185e22df6b8af9ee812
|
7
|
+
data.tar.gz: 6456d2da5d388abc0b095af75dcd87237415659a6db16cbeaef92e5b33dbf246d61dcb28415631869e9996e87a8a36827da1d70554531b6959e5cb3c81509ea7
|
data/circle.yml
ADDED
data/lib/muchkeys/version.rb
CHANGED
data/lib/muchkeys.rb
CHANGED
@@ -90,17 +90,21 @@ module MuchKeys
|
|
90
90
|
|
91
91
|
def fetch_plain_key(key_name)
|
92
92
|
url = consul_url(key_name)
|
93
|
-
|
93
|
+
begin
|
94
|
+
response = Net::HTTP.get_response url
|
94
95
|
|
95
|
-
|
96
|
-
|
96
|
+
return MuchKeys::BlankKey if !response.body || response.body.empty?
|
97
|
+
response.body
|
98
|
+
rescue Errno::ECONNREFUSED
|
99
|
+
return nil
|
100
|
+
end
|
97
101
|
end
|
98
102
|
|
99
103
|
def fetch_secret_key(key_name, public_pem=nil, private_pem=nil)
|
100
104
|
result = fetch_plain_key(key_name)
|
101
105
|
|
102
106
|
# we hit a key that doesn't exist, so don't try to decrypt it
|
103
|
-
return MuchKeys::BlankKey if result == MuchKeys::BlankKey
|
107
|
+
return MuchKeys::BlankKey if result == MuchKeys::BlankKey || result.nil?
|
104
108
|
|
105
109
|
secret_adapter.decrypt_string(result, public_pem, private_pem)
|
106
110
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muchkeys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat O'Brien
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slop
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- LICENSE.txt
|
127
127
|
- README.md
|
128
128
|
- Rakefile
|
129
|
+
- circle.yml
|
129
130
|
- exe/muchkeys
|
130
131
|
- lib/muchkeys.rb
|
131
132
|
- lib/muchkeys/cli.rb
|
@@ -157,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
158
|
version: '0'
|
158
159
|
requirements: []
|
159
160
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
161
|
+
rubygems_version: 2.2.2
|
161
162
|
signing_key:
|
162
163
|
specification_version: 4
|
163
164
|
summary: MuchKeys fetches keys from the ENV and then falls back to consul
|