chef-vault 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/.simplecov +6 -0
- data/.travis.yml +3 -3
- data/Changelog.md +4 -1
- data/Gemfile +1 -1
- data/KNIFE_EXAMPLES.md +8 -0
- data/README.md +18 -1
- data/Rakefile +6 -0
- data/chef-vault.gemspec +5 -4
- data/features/clean_unknown_clients.feature +33 -0
- data/features/step_definitions/chef-repo.rb +7 -0
- data/features/step_definitions/chef-vault.rb +16 -0
- data/features/support/env.rb +4 -0
- data/lib/chef-vault/item.rb +18 -3
- data/lib/chef-vault/version.rb +1 -1
- data/lib/chef/knife/vault_remove.rb +6 -1
- data/lib/chef/knife/vault_rotate_all_keys.rb +12 -7
- data/lib/chef/knife/vault_rotate_keys.rb +6 -1
- data/spec/chef-vault/certificate_spec.rb +4 -7
- data/spec/chef-vault/item_keys_spec.rb +4 -6
- data/spec/chef-vault/item_spec.rb +4 -6
- data/spec/chef-vault/user_spec.rb +4 -8
- data/spec/chef-vault_spec.rb +2 -4
- data/spec/spec_helper.rb +79 -6
- metadata +39 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58db597b870524dd9e554ad60f20722c3b95cf9f
|
4
|
+
data.tar.gz: a49a6a5af9bcb52e84830383957205dd1d4862d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a420cc9e5b246ffcf9c44f3c00ebac5d339f8fe3c6e7c2bbe4849a8fd126cecd4386831549ec0666836ac9304da7641ff1d9f18d1395058aaca5339798f38ef
|
7
|
+
data.tar.gz: f29af664121f81f45070bef3548894729fd0c6e88afba0f2669edd449876c4a1341738ec8e9d375c30044424a4b22b907cfa0ba74ccb8128a14d3a6ac6f479e5
|
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
--color
|
2
|
-
--
|
2
|
+
--require spec_helper
|
data/.simplecov
ADDED
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
## Planned (Unreleased)
|
2
2
|
|
3
3
|
## Released
|
4
|
+
## v2.4.0 / 2014-12-03
|
5
|
+
* add simplecov test coverage configuration (Doug Ireton)
|
6
|
+
* add --clean-unknown-clients switch to knife remove/rotate (Thomas Gschwind and Reto Hermann)
|
7
|
+
|
4
8
|
## v2.3.0 / 2014-10-22
|
5
9
|
* add --clean switch to knife update (thanks to Matt Brimstone)
|
6
10
|
* added aruba CLI testing framework (just for --clean option for now)
|
@@ -81,4 +85,3 @@
|
|
81
85
|
* Add encrypt cert
|
82
86
|
|
83
87
|
## v0.1.1 / 2013-03-14
|
84
|
-
|
data/Gemfile
CHANGED
data/KNIFE_EXAMPLES.md
CHANGED
@@ -142,11 +142,19 @@ Rotate the shared key for the vault passwords and item root. The shared key is t
|
|
142
142
|
|
143
143
|
knife vault rotate keys passwords root
|
144
144
|
|
145
|
+
To remove clients which have been deleted from Chef but not from the vault, add the --clean-unknown-clients switch:
|
146
|
+
|
147
|
+
knife vault rotate keys passwords root --clean-unknown-clients
|
148
|
+
|
145
149
|
### rotate all keys
|
146
150
|
Rotate the shared key for all vaults and items. The shared key is that which is used for the chef encrypted data bag item.
|
147
151
|
|
148
152
|
knife vault rotate all keys
|
149
153
|
|
154
|
+
To remove clients which have been deleted from Chef but not from the vault, add the --clean-unknown-clients switch:
|
155
|
+
|
156
|
+
knife vault rotate keys passwords root --clean-unknown-clients
|
157
|
+
|
150
158
|
### refresh
|
151
159
|
This command reads the search_query in the vault item, performs the search, and reapplies the results.
|
152
160
|
|
data/README.md
CHANGED
@@ -122,6 +122,14 @@ NOTE: chef-vault 1.0 knife commands are not supported! Please use chef-vault 2.
|
|
122
122
|
<td>nil</td>
|
123
123
|
<td>update</td>
|
124
124
|
</tr>
|
125
|
+
<tr>
|
126
|
+
<td>nil</td>
|
127
|
+
<td>--clean-unknown-clients</td>
|
128
|
+
<td>Remove unknown clients during key rotation</td>
|
129
|
+
<td>nil</td>
|
130
|
+
<td>nil</td>
|
131
|
+
<td>remove, rotate</td>
|
132
|
+
</tr>
|
125
133
|
</table>
|
126
134
|
|
127
135
|
## USAGE IN RECIPES
|
@@ -153,12 +161,21 @@ Do `chef-vault --help` for all available options
|
|
153
161
|
|
154
162
|
chef-vault -v passwords -i root -a password -k /etc/chef/knife.rb
|
155
163
|
|
156
|
-
##
|
164
|
+
## Authors
|
157
165
|
|
158
166
|
Author:: Kevin Moser - @moserke<br>
|
159
167
|
Author:: Eli Klein - @eliklein<br>
|
160
168
|
Author:: Joey Geiger - @jgeiger<br>
|
161
169
|
Author:: Joshua Timberman - @jtimberman<br>
|
170
|
+
|
171
|
+
## Contributors
|
172
|
+
|
173
|
+
Contributor:: Matt Brimstone (https://github.com/brimstone)
|
174
|
+
Contributor:: Thomas Gschwind (https://github.com/thg65)
|
175
|
+
Contributor:: Reto Hermann
|
176
|
+
|
177
|
+
## License
|
178
|
+
|
162
179
|
Copyright:: Copyright (c) 2013-14 Nordstrom, Inc.<br>
|
163
180
|
License:: Apache License, Version 2.0
|
164
181
|
|
data/Rakefile
CHANGED
data/chef-vault.gemspec
CHANGED
@@ -34,10 +34,11 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.bindir = 'bin'
|
35
35
|
s.executables = %w( chef-vault )
|
36
36
|
|
37
|
-
s.add_development_dependency '
|
38
|
-
s.add_development_dependency '
|
39
|
-
s.add_development_dependency 'rspec', '~>
|
40
|
-
s.add_development_dependency 'rspec-its', '~> 1.0'
|
37
|
+
s.add_development_dependency 'rake', '~> 10.4'
|
38
|
+
s.add_development_dependency 'rspec', '~> 3.1'
|
39
|
+
s.add_development_dependency 'rspec-its', '~> 1.1'
|
41
40
|
s.add_development_dependency 'aruba', '~> 0.6'
|
42
41
|
s.add_development_dependency 'chef', '>= 0.10.10'
|
42
|
+
s.add_development_dependency 'simplecov', '~> 0.9'
|
43
|
+
s.add_development_dependency 'simplecov-console', '~> 0.2'
|
43
44
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Feature: clean unknown clients on key rotation
|
2
|
+
|
3
|
+
When removing a client from a vault item, chef-vault normally
|
4
|
+
removes the key and then rotates the key. If a client has been
|
5
|
+
deleted in the meantime from the Chef server but not the vault,
|
6
|
+
the rotation will fail due to that client's public key missing.
|
7
|
+
Using the --clean-unknown-clients switch will cause any clients
|
8
|
+
that have been removed to be removed from the vault item's
|
9
|
+
access list as well
|
10
|
+
|
11
|
+
Scenario: Prune clients when removing a client
|
12
|
+
Given a local mode chef repo with nodes 'one,two,three'
|
13
|
+
And I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two,three'
|
14
|
+
Then the vault item 'test/item' should be encrypted for 'one,two,three'
|
15
|
+
And I delete client 'one' from the Chef server
|
16
|
+
And I remove client 'two' from vault item 'test/item' with the 'clean-unknown-clients' option
|
17
|
+
Then the vault item 'test/item' should be encrypted for 'three'
|
18
|
+
|
19
|
+
Scenario: Prune clients when rotating keys
|
20
|
+
Given a local mode chef repo with nodes 'one,two,three'
|
21
|
+
And I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two,three'
|
22
|
+
Then the vault item 'test/item' should be encrypted for 'one,two,three'
|
23
|
+
And I delete client 'one' from the Chef server
|
24
|
+
And I rotate the keys for vault item 'test/item' with the 'clean-unknown-clients' option
|
25
|
+
Then the vault item 'test/item' should be encrypted for 'two,three'
|
26
|
+
|
27
|
+
Scenario: Prune clients when rotating all keys
|
28
|
+
Given a local mode chef repo with nodes 'one,two,three'
|
29
|
+
And I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two,three'
|
30
|
+
Then the vault item 'test/item' should be encrypted for 'one,two,three'
|
31
|
+
And I delete clients 'one,two' from the Chef server
|
32
|
+
And I rotate all keys with the 'clean-unknown-clients' option
|
33
|
+
Then the vault item 'test/item' should be encrypted for 'three'
|
@@ -24,3 +24,10 @@ EOF
|
|
24
24
|
run_simple "knife node create #{node} -z -d -c knife.rb"
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
When /^I delete clients? '(.+)' from the Chef server$/ do |nodelist|
|
29
|
+
nodelist.split(/,/).each do |node|
|
30
|
+
run_simple "knife client delete #{node} -z -d -y -c knife.rb"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
@@ -11,6 +11,22 @@ When /^I update the vault item '(.+)\/(.+)' to be encrypted for '(.+)'( with the
|
|
11
11
|
run_simple "knife vault update #{vault} #{item} -S '#{query}' #{cleanopt ? '--clean' : ''}"
|
12
12
|
end
|
13
13
|
|
14
|
+
When /^I remove clients? '(.+)' from vault item '(.+)\/(.+)' with the '(.+)' options?$/ do |nodelist, vault, item, optionlist|
|
15
|
+
query = nodelist.split(/,/).map{|e| "name:#{e}"}.join(' OR ')
|
16
|
+
options = optionlist.split(/,/).map{|o| "--#{o}"}.join(' ')
|
17
|
+
run_simple "knife vault remove #{vault} #{item} -S '#{query}' #{options}"
|
18
|
+
end
|
19
|
+
|
20
|
+
When /^I rotate the keys for vault item '(.+)\/(.+)' with the '(.+)' options?$/ do |vault, item, optionlist|
|
21
|
+
options = optionlist.split(/,/).map{|o| "--#{o}"}.join(' ')
|
22
|
+
run_simple "knife vault rotate keys #{vault} #{item} #{options}"
|
23
|
+
end
|
24
|
+
|
25
|
+
When /^I rotate all keys with the '(.+)' options?$/ do |optionlist|
|
26
|
+
options = optionlist.split(/,/).map{|o| "--#{o}"}.join(' ')
|
27
|
+
run_simple "knife vault rotate all keys #{options}"
|
28
|
+
end
|
29
|
+
|
14
30
|
Then /^the vault item '(.+)\/(.+)' should( not)? be encrypted for '(.+)'$/ do |vault, item, neg, nodelist|
|
15
31
|
nodes = nodelist.split(/,/)
|
16
32
|
run_simple("knife vault show #{vault} #{item} -z -c knife.rb -p clients -F json")
|
data/features/support/env.rb
CHANGED
data/lib/chef-vault/item.rb
CHANGED
@@ -104,12 +104,27 @@ class ChefVault::Item < Chef::DataBagItem
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
def rotate_keys!
|
107
|
+
def rotate_keys!(clean_unknown_clients=false)
|
108
108
|
@secret = generate_secret
|
109
109
|
|
110
110
|
unless clients.empty?
|
111
|
-
|
112
|
-
|
111
|
+
if clean_unknown_clients
|
112
|
+
clients_to_remove=[]
|
113
|
+
clients.each do |client|
|
114
|
+
begin
|
115
|
+
clients("name:#{client}")
|
116
|
+
rescue ChefVault::Exceptions::ClientNotFound
|
117
|
+
clients_to_remove.push(client)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
clients_to_remove.each do |client|
|
121
|
+
puts "Removing unknown client '#{client}'"
|
122
|
+
clients("name:#{client}", :delete)
|
123
|
+
end
|
124
|
+
else
|
125
|
+
clients.each do |client|
|
126
|
+
clients("name:#{client}")
|
127
|
+
end
|
113
128
|
end
|
114
129
|
end
|
115
130
|
|
data/lib/chef-vault/version.rb
CHANGED
@@ -33,12 +33,17 @@ class Chef
|
|
33
33
|
:long => '--admins ADMINS',
|
34
34
|
:description => 'Chef users to be added as admins'
|
35
35
|
|
36
|
+
option :clean_unknown_clients,
|
37
|
+
:long => '--clean-unknown-clients',
|
38
|
+
:description => 'Remove unknown clients during key rotation'
|
39
|
+
|
36
40
|
def run
|
37
41
|
vault = @name_args[0]
|
38
42
|
item = @name_args[1]
|
39
43
|
values = @name_args[2]
|
40
44
|
search = config[:search]
|
41
45
|
admins = config[:admins]
|
46
|
+
clean_unknown_clients = config[:clean_unknown_clients]
|
42
47
|
json_file = config[:json]
|
43
48
|
|
44
49
|
set_mode(config[:vault_mode])
|
@@ -69,7 +74,7 @@ class Chef
|
|
69
74
|
vault_item.clients(search, :delete) if search
|
70
75
|
vault_item.admins(admins, :delete) if admins
|
71
76
|
|
72
|
-
vault_item.rotate_keys!
|
77
|
+
vault_item.rotate_keys!(clean_unknown_clients)
|
73
78
|
rescue ChefVault::Exceptions::KeysNotFound,
|
74
79
|
ChefVault::Exceptions::ItemNotFound
|
75
80
|
|
@@ -23,21 +23,26 @@ class Chef
|
|
23
23
|
|
24
24
|
banner "knife vault rotate all keys"
|
25
25
|
|
26
|
+
option :clean_unknown_clients,
|
27
|
+
:long => '--clean-unknown-clients',
|
28
|
+
:description => 'Remove unknown clients during key rotation'
|
29
|
+
|
26
30
|
def run
|
31
|
+
clean_unknown_clients = config[:clean_unknown_clients]
|
27
32
|
set_mode(config[:vault_mode])
|
28
|
-
rotate_all_keys
|
33
|
+
rotate_all_keys(clean_unknown_clients)
|
29
34
|
end
|
30
35
|
|
31
36
|
private
|
32
37
|
|
33
|
-
def rotate_all_keys
|
38
|
+
def rotate_all_keys(clean_unknown_clients=false)
|
34
39
|
vaults = Chef::DataBag.list.keys
|
35
|
-
vaults.each { |vault| rotate_vault_keys(vault) }
|
40
|
+
vaults.each { |vault| rotate_vault_keys(vault, clean_unknown_clients) }
|
36
41
|
end
|
37
42
|
|
38
|
-
def rotate_vault_keys(vault)
|
43
|
+
def rotate_vault_keys(vault, clean_unknown_clients)
|
39
44
|
vault_items(vault).each do |item|
|
40
|
-
rotate_vault_item_keys(vault, item)
|
45
|
+
rotate_vault_item_keys(vault, item, clean_unknown_clients)
|
41
46
|
end
|
42
47
|
end
|
43
48
|
|
@@ -48,9 +53,9 @@ class Chef
|
|
48
53
|
end
|
49
54
|
end
|
50
55
|
|
51
|
-
def rotate_vault_item_keys(vault, item)
|
56
|
+
def rotate_vault_item_keys(vault, item, clean_unknown_clients)
|
52
57
|
puts "Rotating keys for: #{vault} #{item}"
|
53
|
-
ChefVault::Item.load(vault, item).rotate_keys!
|
58
|
+
ChefVault::Item.load(vault, item).rotate_keys!(clean_unknown_clients)
|
54
59
|
end
|
55
60
|
end
|
56
61
|
end
|
@@ -23,16 +23,21 @@ class Chef
|
|
23
23
|
|
24
24
|
banner "knife vault rotate keys VAULT ITEM (options)"
|
25
25
|
|
26
|
+
option :clean_unknown_clients,
|
27
|
+
:long => '--clean-unknown-clients',
|
28
|
+
:description => 'Remove unknown clients during key rotation'
|
29
|
+
|
26
30
|
def run
|
27
31
|
vault = @name_args[0]
|
28
32
|
item = @name_args[1]
|
33
|
+
clean_unknown_clients = config[:clean_unknown_clients]
|
29
34
|
|
30
35
|
if vault && item
|
31
36
|
set_mode(config[:vault_mode])
|
32
37
|
|
33
38
|
begin
|
34
39
|
item = ChefVault::Item.load(vault, item)
|
35
|
-
item.rotate_keys!
|
40
|
+
item.rotate_keys!(clean_unknown_clients)
|
36
41
|
rescue ChefVault::Exceptions::KeysNotFound,
|
37
42
|
ChefVault::Exceptions::ItemNotFound
|
38
43
|
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe ChefVault::Certificate do
|
1
|
+
RSpec.describe ChefVault::Certificate do
|
4
2
|
let(:item) { double(ChefVault::Item) }
|
5
3
|
let(:cert) { ChefVault::Certificate.new("foo", "bar") }
|
6
4
|
|
@@ -19,21 +17,20 @@ describe ChefVault::Certificate do
|
|
19
17
|
end
|
20
18
|
|
21
19
|
describe '#[]' do
|
22
|
-
specify { cert[
|
20
|
+
specify { expect(cert['id']).to eq 'bar' }
|
23
21
|
end
|
24
22
|
|
25
23
|
describe 'decrypt_contents' do
|
26
24
|
|
27
25
|
it 'echoes warning' do
|
28
|
-
STDOUT.
|
29
|
-
|
26
|
+
expect(STDOUT).to receive(:puts).with("WARNING: This method is deprecated, please switch to item['value'] calls")
|
30
27
|
cert.decrypt_contents
|
31
28
|
end
|
32
29
|
|
33
30
|
it 'returns items contents' do
|
34
31
|
expect(item).to receive(:[]).with("contents")
|
35
32
|
|
36
|
-
cert.decrypt_contents.
|
33
|
+
expect(cert.decrypt_contents).to eq 'baz'
|
37
34
|
end
|
38
35
|
end
|
39
36
|
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe ChefVault::ItemKeys do
|
1
|
+
RSpec.describe ChefVault::ItemKeys do
|
4
2
|
describe '#new' do
|
5
3
|
subject(:keys) { ChefVault::ItemKeys.new("foo", "bar") }
|
6
4
|
|
@@ -8,10 +6,10 @@ describe ChefVault::ItemKeys do
|
|
8
6
|
|
9
7
|
its(:data_bag) { should eq "foo" }
|
10
8
|
|
11
|
-
specify { keys["id"].
|
9
|
+
specify { expect(keys["id"]).to eq 'bar' }
|
12
10
|
|
13
|
-
specify { keys["admins"].
|
11
|
+
specify { expect(keys["admins"]).to eq [] }
|
14
12
|
|
15
|
-
specify { keys["clients"].
|
13
|
+
specify { expect(keys["clients"]).to eq [] }
|
16
14
|
end
|
17
15
|
end
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe ChefVault::Item do
|
1
|
+
RSpec.describe ChefVault::Item do
|
4
2
|
subject(:item) { ChefVault::Item.new("foo", "bar") }
|
5
3
|
|
6
4
|
describe '#new' do
|
@@ -11,11 +9,11 @@ describe ChefVault::Item do
|
|
11
9
|
|
12
10
|
its(:data_bag) { should eq "foo" }
|
13
11
|
|
14
|
-
specify { item[
|
12
|
+
specify { expect(item['id']).to eq 'bar' }
|
15
13
|
|
16
|
-
specify { item.keys[
|
14
|
+
specify { expect(item.keys['id']).to eq 'bar_keys' }
|
17
15
|
|
18
|
-
specify { item.keys.data_bag.
|
16
|
+
specify { expect(item.keys.data_bag).to eq 'foo' }
|
19
17
|
end
|
20
18
|
|
21
19
|
describe '#save' do
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe ChefVault::User do
|
1
|
+
RSpec.describe ChefVault::User do
|
4
2
|
let(:item) { double(ChefVault::Item) }
|
5
3
|
let(:user) { ChefVault::User.new("foo", "bar") }
|
6
4
|
|
@@ -19,21 +17,19 @@ describe ChefVault::User do
|
|
19
17
|
end
|
20
18
|
|
21
19
|
describe '#[]' do
|
22
|
-
specify { user[
|
20
|
+
specify { expect(user['id']).to eq 'bar' }
|
23
21
|
end
|
24
22
|
|
25
23
|
describe 'decrypt_password' do
|
26
24
|
|
27
25
|
it 'echoes warning' do
|
28
|
-
STDOUT.
|
29
|
-
|
26
|
+
expect(STDOUT).to receive(:puts).with("WARNING: This method is deprecated, please switch to item['value'] calls")
|
30
27
|
user.decrypt_password
|
31
28
|
end
|
32
29
|
|
33
30
|
it 'returns items password' do
|
34
31
|
expect(item).to receive(:[]).with("password")
|
35
|
-
|
36
|
-
user.decrypt_password.should eq "baz"
|
32
|
+
expect(user.decrypt_password).to eq "baz"
|
37
33
|
end
|
38
34
|
end
|
39
35
|
|
data/spec/chef-vault_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe ChefVault do
|
1
|
+
RSpec.describe ChefVault do
|
4
2
|
subject(:vault) { ChefVault.new('foo') }
|
5
3
|
|
6
4
|
describe '#new' do
|
@@ -12,7 +10,7 @@ describe ChefVault do
|
|
12
10
|
|
13
11
|
context 'with a vault and config file parameter specified' do
|
14
12
|
before do
|
15
|
-
IO.
|
13
|
+
allow(IO).to receive(:read).with('knife.rb').and_return("node_name 'bar'")
|
16
14
|
end
|
17
15
|
|
18
16
|
let(:vault) { ChefVault.new('foo', 'knife.rb') }
|
data/spec/spec_helper.rb
CHANGED
@@ -1,21 +1,94 @@
|
|
1
|
+
if ENV['COVERAGE']
|
2
|
+
require 'simplecov'
|
3
|
+
end
|
4
|
+
|
1
5
|
require_relative '../lib/chef-vault'
|
2
6
|
|
3
7
|
require 'rspec/its'
|
4
|
-
|
5
8
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
6
9
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
7
|
-
#
|
8
|
-
# loaded
|
10
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
11
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
12
|
+
#
|
13
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
14
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
15
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
16
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
17
|
+
# a separate helper file that requires the additional dependencies and performs
|
18
|
+
# the additional setup, and require it from the spec files that actually need it.
|
19
|
+
#
|
20
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
21
|
+
# users commonly want.
|
9
22
|
#
|
10
23
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
11
24
|
RSpec.configure do |config|
|
12
|
-
config.
|
13
|
-
|
25
|
+
# rspec-expectations config goes here. You can use an alternate
|
26
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
27
|
+
# assertions if you prefer.
|
28
|
+
config.expect_with :rspec do |expectations|
|
29
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
30
|
+
# and `failure_message` of custom matchers include text for helper methods
|
31
|
+
# defined using `chain`, e.g.:
|
32
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
33
|
+
# # => "be bigger than 2 and smaller than 4"
|
34
|
+
# ...rather than:
|
35
|
+
# # => "be bigger than 2"
|
36
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
37
|
+
end
|
38
|
+
|
39
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
40
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
41
|
+
config.mock_with :rspec do |mocks|
|
42
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
43
|
+
# a real object. This is generally recommended, and will default to
|
44
|
+
# `true` in RSpec 4.
|
45
|
+
mocks.verify_partial_doubles = true
|
46
|
+
end
|
47
|
+
|
48
|
+
# The settings below are suggested to provide a good initial experience
|
49
|
+
# with RSpec, but feel free to customize to your heart's content.
|
50
|
+
# These two settings work together to allow you to limit a spec run
|
51
|
+
# to individual examples or groups you care about by tagging them with
|
52
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
53
|
+
# get run.
|
14
54
|
config.filter_run :focus
|
55
|
+
config.run_all_when_everything_filtered = true
|
56
|
+
|
57
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
58
|
+
# For more details, see:
|
59
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
60
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
61
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
62
|
+
config.disable_monkey_patching!
|
63
|
+
|
64
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
65
|
+
# be too noisy due to issues in dependencies.
|
66
|
+
# config.warnings = true
|
67
|
+
|
68
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
69
|
+
# file, and it's useful to allow more verbose output when running an
|
70
|
+
# individual spec file.
|
71
|
+
if config.files_to_run.one?
|
72
|
+
# Use the documentation formatter for detailed output,
|
73
|
+
# unless a formatter has already been configured
|
74
|
+
# (e.g. via a command-line flag).
|
75
|
+
config.default_formatter = 'doc'
|
76
|
+
end
|
77
|
+
|
78
|
+
# Print the 10 slowest examples and example groups at the
|
79
|
+
# end of the spec run, to help surface which specs are running
|
80
|
+
# particularly slow.
|
81
|
+
config.profile_examples = 10
|
15
82
|
|
16
83
|
# Run specs in random order to surface order dependencies. If you find an
|
17
84
|
# order dependency and want to debug it, you can fix the order by providing
|
18
85
|
# the seed, which is printed after each run.
|
19
86
|
# --seed 1234
|
20
|
-
config.order =
|
87
|
+
config.order = :random
|
88
|
+
|
89
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
90
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
91
|
+
# test failures related to randomization by passing the same `--seed` value
|
92
|
+
# as the one that triggered the failure.
|
93
|
+
Kernel.srand config.seed
|
21
94
|
end
|
metadata
CHANGED
@@ -1,71 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-vault
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Moser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '10.4'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
26
|
+
version: '10.4'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rspec
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
33
|
+
version: '3.1'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
40
|
+
version: '3.1'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec-its
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
47
|
+
version: '1.1'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
54
|
+
version: '1.1'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: aruba
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +80,34 @@ dependencies:
|
|
94
80
|
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: 0.10.10
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.9'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.9'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov-console
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.2'
|
97
111
|
description: Data encryption support for Chef using data bags
|
98
112
|
email:
|
99
113
|
- kevin.moser@nordstrom.com
|
@@ -104,6 +118,7 @@ extra_rdoc_files: []
|
|
104
118
|
files:
|
105
119
|
- ".gitignore"
|
106
120
|
- ".rspec"
|
121
|
+
- ".simplecov"
|
107
122
|
- ".travis.yml"
|
108
123
|
- CONTRIBUTING.md
|
109
124
|
- Changelog.md
|
@@ -116,6 +131,7 @@ files:
|
|
116
131
|
- bin/chef-vault
|
117
132
|
- chef-vault.gemspec
|
118
133
|
- features/clean.feature
|
134
|
+
- features/clean_unknown_clients.feature
|
119
135
|
- features/step_definitions/chef-repo.rb
|
120
136
|
- features/step_definitions/chef-vault.rb
|
121
137
|
- features/support/env.rb
|