chef-vault 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/Changelog.md +5 -0
- data/README.md +5 -0
- data/chef-vault.gemspec +2 -3
- data/lib/chef-vault.rb +6 -1
- data/lib/chef-vault/item_keys.rb +1 -1
- data/lib/chef-vault/version.rb +1 -1
- data/spec/chef-vault/certificate_spec.rb +3 -1
- data/spec/chef-vault/item_keys_spec.rb +13 -7
- data/spec/chef-vault/item_spec.rb +20 -9
- data/spec/chef-vault/user_spec.rb +3 -1
- data/spec/chef-vault_spec.rb +20 -14
- data/spec/spec_helper.rb +0 -2
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 297b60d8521397a8eeeded373503b9edb33b3195
|
4
|
+
data.tar.gz: 41a79787ab86193433047cdd6d9df05653ba1bf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807c5cf031f54b6bff3b505eaa0a832387369d49340fdd96fb0956d35fdc26d96be34695be6ac0a0a1be1d280219f1cf25d3fcfaa680234a37e6a4d6754c50ef
|
7
|
+
data.tar.gz: ea0973774c69df1a76e587d02e075209feee0ac01bfd590be9813889def4a147da057b907a8b66ca3dadbbdbc107f8fd83932ce638fd25ade5b45729098e6cfb
|
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
@@ -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
|
[](https://codeclimate.com/github/Nordstrom/chef-vault)
|
10
10
|
|
11
|
+
[](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>
|
data/chef-vault.gemspec
CHANGED
@@ -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 = ['
|
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'
|
data/lib/chef-vault.rb
CHANGED
@@ -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'
|
data/lib/chef-vault/item_keys.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
class ChefVault
|
18
18
|
class ItemKeys < Chef::DataBagItem
|
19
19
|
def initialize(vault, name)
|
20
|
-
super() #
|
20
|
+
super() # parentheses required to strip off parameters
|
21
21
|
@data_bag = vault
|
22
22
|
@raw_data["id"] = name
|
23
23
|
@raw_data["admins"] = []
|
data/lib/chef-vault/version.rb
CHANGED
@@ -23,7 +23,9 @@ RSpec.describe ChefVault::Certificate do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
describe '#[]' do
|
26
|
-
|
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
|
-
|
3
|
+
let(:keys) { ChefVault::ItemKeys.new("foo", "bar") }
|
4
4
|
|
5
|
-
it
|
5
|
+
it "'foo' is assigned to @data_bag" do
|
6
|
+
expect(keys.data_bag).to eq 'foo'
|
7
|
+
end
|
6
8
|
|
7
|
-
|
9
|
+
it "sets the keys id to 'bar'" do
|
10
|
+
expect(keys["id"]).to eq 'bar'
|
11
|
+
end
|
8
12
|
|
9
|
-
|
13
|
+
it 'initializes the keys[admin] to an empty array' do
|
14
|
+
expect(keys['admins']).to eq []
|
15
|
+
end
|
10
16
|
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
133
|
-
|
134
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 '
|
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)
|
data/spec/chef-vault_spec.rb
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
RSpec.describe ChefVault do
|
2
|
-
|
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
|
-
|
9
|
-
|
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
|
-
|
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
|
-
|
18
|
+
let(:vault) { ChefVault.new('foo', 'knife.rb') }
|
19
19
|
|
20
|
-
|
20
|
+
it "assigns 'foo' to the vault accessor" do
|
21
|
+
expect(vault.vault).to eq 'foo'
|
22
|
+
end
|
21
23
|
|
22
|
-
|
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
|
-
|
26
|
-
|
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
|
data/spec/spec_helper.rb
CHANGED
@@ -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.
|
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-
|
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
|
-
-
|
114
|
+
- techcheftm@nordstrom.com
|
128
115
|
executables:
|
129
116
|
- chef-vault
|
130
117
|
extensions: []
|