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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b1691f5996a3bbe70a2dc689f6168b08859f5a7
4
- data.tar.gz: 1d49e1b24e67b72c55adf5ed724e0269e0ac0a0a
3
+ metadata.gz: 0ad2ab8e2bfa75fd797b36be39c1a8184ce7484e
4
+ data.tar.gz: 3f21dc427fb84b6f2d7b23238e1200d5578620bc
5
5
  SHA512:
6
- metadata.gz: d4ec21f49f82ce55a894ce5fbfaf8b5a567fe56dd0313576e17d7a1cc553dd08a6895877df76176694e90e890e8d6063ba146f1032e482ed437bbca2c54a9a3c
7
- data.tar.gz: c49e8fe3eab027bfe23c032eba3bae91dd54e9320035221a5fac78471150f4f646cb9bd8628730a20298a799ca64dfa8e0fab4d61f2bd97037f721ab6b00c300
6
+ metadata.gz: 64c72caa89877fb1e9b091efe521b45378fb7b5da1ae6133e4f976252b398d2a54e0a7afda1cbe6cf0c8f8b8215eab4e0ab84fc86e527185e22df6b8af9ee812
7
+ data.tar.gz: 6456d2da5d388abc0b095af75dcd87237415659a6db16cbeaef92e5b33dbf246d61dcb28415631869e9996e87a8a36827da1d70554531b6959e5cb3c81509ea7
data/circle.yml ADDED
@@ -0,0 +1,10 @@
1
+ machine:
2
+ ruby:
3
+ version: 2.1.6
4
+ timezone:
5
+ Etc/GMT
6
+
7
+ checkout:
8
+ post:
9
+ - gem install bundler -v 1.12.4
10
+
@@ -1,3 +1,3 @@
1
1
  module MuchKeys
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
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
- response = Net::HTTP.get_response url
93
+ begin
94
+ response = Net::HTTP.get_response url
94
95
 
95
- return MuchKeys::BlankKey if !response.body || response.body.empty?
96
- response.body
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.6
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-05-04 00:00:00.000000000 Z
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.4.5.1
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