chef-vault 2.5.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +5 -1
  3. data/.travis.yml +5 -1
  4. data/Changelog.md +36 -3
  5. data/KNIFE_EXAMPLES.md +49 -74
  6. data/README.md +166 -104
  7. data/THEORY.md +4 -2
  8. data/bin/chef-vault +2 -2
  9. data/chef-vault.gemspec +2 -2
  10. data/features/clean_on_refresh.feature +28 -0
  11. data/features/isvault.feature +24 -0
  12. data/features/itemtype.feature +25 -0
  13. data/features/step_definitions/chef-databag.rb +4 -0
  14. data/features/step_definitions/chef-vault.rb +21 -0
  15. data/features/step_definitions/chef_databagitem.rb +9 -0
  16. data/features/vault_show_vaultname.feature +22 -0
  17. data/features/vault_update.feature +1 -1
  18. data/features/verify_id_matches.feature +11 -0
  19. data/lib/chef-vault/certificate.rb +1 -1
  20. data/lib/chef-vault/exceptions.rb +3 -0
  21. data/lib/chef-vault/item.rb +161 -18
  22. data/lib/chef-vault/user.rb +1 -1
  23. data/lib/chef-vault/version.rb +1 -1
  24. data/lib/chef/knife/decrypt.rb +1 -1
  25. data/lib/chef/knife/encrypt_create.rb +1 -1
  26. data/lib/chef/knife/encrypt_delete.rb +1 -1
  27. data/lib/chef/knife/encrypt_remove.rb +1 -1
  28. data/lib/chef/knife/encrypt_rotate_keys.rb +1 -1
  29. data/lib/chef/knife/encrypt_update.rb +1 -1
  30. data/lib/chef/knife/vault_base.rb +22 -0
  31. data/lib/chef/knife/vault_create.rb +0 -1
  32. data/lib/chef/knife/vault_decrypt.rb +1 -1
  33. data/lib/chef/knife/vault_isvault.rb +43 -0
  34. data/lib/chef/knife/vault_itemtype.rb +43 -0
  35. data/lib/chef/knife/vault_list.rb +7 -18
  36. data/lib/chef/knife/vault_refresh.rb +6 -12
  37. data/lib/chef/knife/vault_rotate_all_keys.rb +1 -1
  38. data/lib/chef/knife/vault_show.rb +15 -1
  39. data/lib/chef/knife/vault_update.rb +1 -1
  40. data/spec/chef-vault/certificate_spec.rb +9 -2
  41. data/spec/chef-vault/item_spec.rb +164 -3
  42. data/spec/chef-vault/user_spec.rb +9 -2
  43. metadata +14 -6
@@ -6,6 +6,12 @@ RSpec.describe ChefVault::User do
6
6
  allow(ChefVault::Item).to receive(:load).with("foo", "bar"){ item }
7
7
  allow(item).to receive(:[]).with("id"){ "bar" }
8
8
  allow(item).to receive(:[]).with("password"){ "baz" }
9
+ @orig_stdout = $stdout
10
+ $stdout = File.open(File::NULL, 'w')
11
+ end
12
+
13
+ after do
14
+ $stdout = @orig_stdout
9
15
  end
10
16
 
11
17
  describe '#new' do
@@ -22,8 +28,9 @@ RSpec.describe ChefVault::User do
22
28
 
23
29
  describe 'decrypt_password' do
24
30
  it 'echoes warning' do
25
- expect(STDOUT).to receive(:puts).with("WARNING: This method is deprecated, please switch to item['value'] calls")
26
- user.decrypt_password
31
+ expect { user.decrypt_password }
32
+ .to output("WARNING: This method is deprecated, please switch to item['value'] calls\n")
33
+ .to_stdout
27
34
  end
28
35
 
29
36
  it 'returns items password' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.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: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.1'
33
+ version: '3.2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.1'
40
+ version: '3.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-its
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0.29'
103
+ version: '0.30'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0.29'
110
+ version: '0.30'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: chef
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -148,15 +148,21 @@ files:
148
148
  - bin/chef-vault
149
149
  - chef-vault.gemspec
150
150
  - features/clean.feature
151
+ - features/clean_on_refresh.feature
151
152
  - features/clean_unknown_clients.feature
153
+ - features/isvault.feature
154
+ - features/itemtype.feature
152
155
  - features/step_definitions/chef-databag.rb
153
156
  - features/step_definitions/chef-repo.rb
154
157
  - features/step_definitions/chef-vault.rb
158
+ - features/step_definitions/chef_databagitem.rb
155
159
  - features/support/env.rb
156
160
  - features/vault_create.feature
157
161
  - features/vault_list.feature
158
162
  - features/vault_show.feature
163
+ - features/vault_show_vaultname.feature
159
164
  - features/vault_update.feature
165
+ - features/verify_id_matches.feature
160
166
  - features/wrong_private_key.feature
161
167
  - lib/chef-vault.rb
162
168
  - lib/chef-vault/certificate.rb
@@ -182,6 +188,8 @@ files:
182
188
  - lib/chef/knife/vault_delete.rb
183
189
  - lib/chef/knife/vault_download.rb
184
190
  - lib/chef/knife/vault_edit.rb
191
+ - lib/chef/knife/vault_isvault.rb
192
+ - lib/chef/knife/vault_itemtype.rb
185
193
  - lib/chef/knife/vault_list.rb
186
194
  - lib/chef/knife/vault_refresh.rb
187
195
  - lib/chef/knife/vault_remove.rb