chef-vault 2.6.0 → 2.6.1

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: 9b27ba9a529d3f084f1e83119a6b6bf91819ba3a
4
- data.tar.gz: eacae88edbe78fc8e0a27c7f6e5680b1e75e974d
3
+ metadata.gz: 297b60d8521397a8eeeded373503b9edb33b3195
4
+ data.tar.gz: 41a79787ab86193433047cdd6d9df05653ba1bf8
5
5
  SHA512:
6
- metadata.gz: 1d18b4a6f3cfedf225041ee9b6e8c05b2c476f9fa8f04903038cec23bf631ee9a135c6c7199c26ce49971ed415651b22ec552bacd2cc684aa4a749096db90c81
7
- data.tar.gz: 0895619aff3da11cb0d024bb87d8cbe00ba1330b4aa80bd6537cf1d2600f6b814e63ea291338c69d08456633d572d0464ab6a0b278018a0d7f95a8d2cd74070f
6
+ metadata.gz: 807c5cf031f54b6bff3b505eaa0a832387369d49340fdd96fb0956d35fdc26d96be34695be6ac0a0a1be1d280219f1cf25d3fcfaa680234a37e6a4d6754c50ef
7
+ data.tar.gz: ea0973774c69df1a76e587d02e075209feee0ac01bfd590be9813889def4a147da057b907a8b66ca3dadbbdbc107f8fd83932ce638fd25ade5b45729098e6cfb
@@ -9,3 +9,10 @@ env: TRAVIS_BUILD=true
9
9
  matrix:
10
10
  allow_failures:
11
11
  - rvm: "1.9.3-p551"
12
+ notifications:
13
+ webhooks:
14
+ urls:
15
+ - https://webhooks.gitter.im/e/60e610197dad8edc59f9
16
+ on_success: always
17
+ on_failure: always
18
+ on_start: false
@@ -25,6 +25,11 @@ This release will also remove the chef-vault 1.x commands (encrypt/decrypt)
25
25
 
26
26
  ## Released
27
27
 
28
+ ## v2.6.1
29
+
30
+ * Remove dependency on [rspec-its](https://github.com/rspec/rspec-its)
31
+ * (via Chef/Dan DeLeo): reduce the number of parts of chef that chef-vault `require`s to easy integration of chef-vault into ChefDK
32
+
28
33
  ## v2.6.0 / 2015-05-13
29
34
 
30
35
  * ChefVault::Item#clients can now accept a Chef::ApiClient object instead of a search string. Requested by @lamont-granquist to make implementing chef-vault into `knife bootstrap` easier
data/README.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  [![Code Climate](https://codeclimate.com/github/Nordstrom/chef-vault/badges/gpa.svg)](https://codeclimate.com/github/Nordstrom/chef-vault)
10
10
 
11
+ [![Join the chat at https://gitter.im/Nordstrom/chef-vault](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Nordstrom/chef-vault)
12
+
11
13
  ## DESCRIPTION:
12
14
 
13
15
  Gem that allows you to encrypt a Chef Data Bag Item using the public keys of
@@ -227,6 +229,9 @@ small pull requests are preferred to large omnibus patches, as the
227
229
  robustness pass is a multi-person effort and we don't want to create merge
228
230
  conflicts unnecessarily.
229
231
 
232
+ We also have a [Gitter room](https://gitter.im/Nordstrom/chef-vault)
233
+ where you can discuss chef-vault and the robustness improvements.
234
+
230
235
  ## Authors
231
236
 
232
237
  Author:: Kevin Moser - @moserke<br>
@@ -21,8 +21,8 @@ Gem::Specification.new do |s|
21
21
  s.name = 'chef-vault'
22
22
  s.version = ChefVault::VERSION
23
23
  s.has_rdoc = true
24
- s.authors = ['Kevin Moser']
25
- s.email = ['kevin.moser@nordstrom.com']
24
+ s.authors = ['Kevin Moser', 'James FitzGibbon']
25
+ s.email = ['techcheftm@nordstrom.com']
26
26
  s.summary = 'Data encryption support for Chef using data bags'
27
27
  s.description = s.summary
28
28
  s.homepage = 'https://github.com/Nordstrom/chef-vault'
@@ -36,7 +36,6 @@ Gem::Specification.new do |s|
36
36
 
37
37
  s.add_development_dependency 'rake', '~> 10.4'
38
38
  s.add_development_dependency 'rspec', '~> 3.2'
39
- s.add_development_dependency 'rspec-its', '~> 1.1'
40
39
  s.add_development_dependency 'aruba', '~> 0.6'
41
40
  s.add_development_dependency 'simplecov', '~> 0.9'
42
41
  s.add_development_dependency 'simplecov-console', '~> 0.2'
@@ -16,7 +16,12 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require 'chef'
19
+ require 'chef/search/query'
20
+ require 'chef/version'
21
+ require 'chef/config'
22
+ require 'chef/api_client'
23
+ require 'chef/data_bag_item'
24
+ require 'chef/encrypted_data_bag_item'
20
25
  require 'chef/user'
21
26
  require 'chef-vault/version'
22
27
  require 'chef-vault/exceptions'
@@ -17,7 +17,7 @@
17
17
  class ChefVault
18
18
  class ItemKeys < Chef::DataBagItem
19
19
  def initialize(vault, name)
20
- super() # parenthesis required to strip off parameters
20
+ super() # parentheses required to strip off parameters
21
21
  @data_bag = vault
22
22
  @raw_data["id"] = name
23
23
  @raw_data["admins"] = []
@@ -14,6 +14,6 @@
14
14
  # limitations under the License.
15
15
 
16
16
  class ChefVault
17
- VERSION = '2.6.0'
17
+ VERSION = '2.6.1'
18
18
  MAJOR, MINOR, TINY = VERSION.split('.')
19
19
  end
@@ -23,7 +23,9 @@ RSpec.describe ChefVault::Certificate do
23
23
  end
24
24
 
25
25
  describe '#[]' do
26
- specify { expect(cert['id']).to eq 'bar' }
26
+ it "given an 'id' parameter, returns its value" do
27
+ expect(cert['id']).to eq 'bar'
28
+ end
27
29
  end
28
30
 
29
31
  describe 'decrypt_contents' do
@@ -1,15 +1,21 @@
1
1
  RSpec.describe ChefVault::ItemKeys do
2
2
  describe '#new' do
3
- subject(:keys) { ChefVault::ItemKeys.new("foo", "bar") }
3
+ let(:keys) { ChefVault::ItemKeys.new("foo", "bar") }
4
4
 
5
- it { should be_an_instance_of ChefVault::ItemKeys }
5
+ it "'foo' is assigned to @data_bag" do
6
+ expect(keys.data_bag).to eq 'foo'
7
+ end
6
8
 
7
- its(:data_bag) { should eq "foo" }
9
+ it "sets the keys id to 'bar'" do
10
+ expect(keys["id"]).to eq 'bar'
11
+ end
8
12
 
9
- specify { expect(keys["id"]).to eq 'bar' }
13
+ it 'initializes the keys[admin] to an empty array' do
14
+ expect(keys['admins']).to eq []
15
+ end
10
16
 
11
- specify { expect(keys["admins"]).to eq [] }
12
-
13
- specify { expect(keys["clients"]).to eq [] }
17
+ it 'initializes the keys[clients] to an empty array' do
18
+ expect(keys['admins']).to eq []
19
+ end
14
20
  end
15
21
  end
@@ -129,17 +129,25 @@ RSpec.describe ChefVault::Item do
129
129
  end
130
130
 
131
131
  describe '::new' do
132
- it { should be_an_instance_of ChefVault::Item }
133
-
134
- its(:keys) { should be_an_instance_of ChefVault::ItemKeys }
132
+ it 'item[keys] is an instance of ChefVault::ItemKeys' do
133
+ expect(item.keys).to be_an_instance_of(ChefVault::ItemKeys)
134
+ end
135
135
 
136
- its(:data_bag) { should eq "foo" }
136
+ it "the item's 'vault' parameter is assigned to data_bag" do
137
+ expect(item.data_bag).to eq 'foo'
138
+ end
137
139
 
138
- specify { expect(item['id']).to eq 'bar' }
140
+ it "the vault item name is assiged to the data bag ['id']" do
141
+ expect(item['id']).to eq 'bar'
142
+ end
139
143
 
140
- specify { expect(item.keys['id']).to eq 'bar_keys' }
144
+ it "creates a corresponding 'keys' data bag with an '_keys' id" do
145
+ expect(item.keys['id']).to eq 'bar_keys'
146
+ end
141
147
 
142
- specify { expect(item.keys.data_bag).to eq 'foo' }
148
+ it "sets the item keys data bag to 'foo'" do
149
+ expect(item.keys.data_bag).to eq 'foo'
150
+ end
143
151
 
144
152
  it 'defaults the node name' do
145
153
  item = ChefVault::Item.new('foo', 'bar')
@@ -205,10 +213,13 @@ RSpec.describe ChefVault::Item do
205
213
  describe '#save' do
206
214
  context 'when item["id"] is bar.bar' do
207
215
  let(:item) { ChefVault::Item.new("foo", "bar.bar") }
208
- specify { expect { item.save }.to raise_error }
216
+ it "raises an error on save with an invalid item['id']" do
217
+ expect { item.save }.to raise_error
218
+
219
+ end
209
220
  end
210
221
 
211
- it 'should validate that the id of the vault matches the id of the keys data bag' do
222
+ it 'validates that the id of the vault matches the id of the keys data bag' do
212
223
  item = ChefVault::Item.new('foo', 'bar')
213
224
  item['id'] = 'baz'
214
225
  item.keys['clients'] = %w(admin)
@@ -23,7 +23,9 @@ RSpec.describe ChefVault::User do
23
23
  end
24
24
 
25
25
  describe '#[]' do
26
- specify { expect(user['id']).to eq 'bar' }
26
+ it "returns the value of the 'id' parameter" do
27
+ expect(user['id']).to eq 'bar'
28
+ end
27
29
  end
28
30
 
29
31
  describe 'decrypt_password' do
@@ -1,29 +1,35 @@
1
1
  RSpec.describe ChefVault do
2
- subject(:vault) { ChefVault.new('foo') }
2
+ let(:vault) { ChefVault.new('foo') }
3
3
 
4
4
  describe '#new' do
5
5
  context 'with only a vault parameter specified' do
6
- it { should be_an_instance_of ChefVault }
7
6
 
8
- its(:vault) { should eq "foo" }
9
- end
10
-
11
- context 'with a vault and config file parameter specified' do
12
- before do
13
- allow(IO).to receive(:read).with('knife.rb').and_return("node_name 'bar'")
7
+ it "assigns 'foo' to the vault accessor" do
8
+ expect(vault.vault).to eq 'foo'
14
9
  end
10
+ end
11
+ end
15
12
 
16
- let(:vault) { ChefVault.new('foo', 'knife.rb') }
13
+ context 'with a vault and config file parameter specified' do
14
+ before do
15
+ allow(IO).to receive(:read).with('knife.rb').and_return("node_name 'myserver'")
16
+ end
17
17
 
18
- it { should be_an_instance_of ChefVault }
18
+ let(:vault) { ChefVault.new('foo', 'knife.rb') }
19
19
 
20
- its(:vault) { should eq "foo" }
20
+ it "assigns 'foo' to the vault accessor" do
21
+ expect(vault.vault).to eq 'foo'
22
+ end
21
23
 
22
- specify { expect { Chef::Config[:node_name].should eq "bar" } }
24
+ it 'loads the Chef config values' do
25
+ expect(ChefVault).to receive(:load_config).with('knife.rb')
26
+ vault
23
27
  end
28
+ end
24
29
 
25
- describe '#version' do
26
- its(:version) { should eq ChefVault::VERSION }
30
+ describe '#version' do
31
+ it 'the version method equals VERSION' do
32
+ expect(vault.version).to eq(ChefVault::VERSION)
27
33
  end
28
34
  end
29
35
  end
@@ -1,8 +1,6 @@
1
1
  require 'simplecov' if ENV['COVERAGE']
2
-
3
2
  require_relative '../lib/chef-vault'
4
3
 
5
- require 'rspec/its'
6
4
  # This file was generated by the `rspec --init` command. Conventionally, all
7
5
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
8
6
  # The generated `.rspec` file contains `--require spec_helper` which will cause this
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Moser
8
+ - James FitzGibbon
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-05-13 00:00:00.000000000 Z
12
+ date: 2015-05-28 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
@@ -38,20 +39,6 @@ dependencies:
38
39
  - - "~>"
39
40
  - !ruby/object:Gem::Version
40
41
  version: '3.2'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec-its
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.1'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.1'
55
42
  - !ruby/object:Gem::Dependency
56
43
  name: aruba
57
44
  requirement: !ruby/object:Gem::Requirement
@@ -124,7 +111,7 @@ dependencies:
124
111
  version: 0.10.10
125
112
  description: Data encryption support for Chef using data bags
126
113
  email:
127
- - kevin.moser@nordstrom.com
114
+ - techcheftm@nordstrom.com
128
115
  executables:
129
116
  - chef-vault
130
117
  extensions: []