chef-vault 2.8.0 → 2.9.0
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/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/Changelog.md +242 -119
- data/Gemfile +8 -1
- data/Rakefile +1 -0
- data/bin/chef-vault +1 -1
- data/features/detect_and_warn_v1_vault.feature +2 -2
- data/features/step_definitions/chef-repo.rb +1 -0
- data/features/step_definitions/chef-vault.rb +17 -1
- data/features/vault_update.feature +11 -9
- data/lib/chef-vault/item.rb +24 -21
- data/lib/chef-vault/version.rb +1 -1
- data/lib/chef/knife/vault_create.rb +2 -1
- data/lib/chef/knife/vault_rotate_all_keys.rb +1 -1
- data/lib/chef/knife/vault_update.rb +18 -10
- data/spec/chef-vault/item_spec.rb +30 -1
- data/tasks/github_changelog_generator.rb +31 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c90203a9c213aa3133e77ef37578555a361ea78f
|
|
4
|
+
data.tar.gz: 145c8e5648f61434f2456d30c552bd37e324b22c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48b43f9d6b2844348ec404aca801004bb4df6c6762558955713c3211c8efe7bca8b9029b4d66db41feac40626f79cf37c295dd3473ab4660452916f2edec985a
|
|
7
|
+
data.tar.gz: dac7905cc1eac1ba15976b75558b9c08651cb035de7d7b96abfc5c196ca653298b5d73bf286e131c242b4529d57ad18359767c561fd05a26103f2834dbccdefe
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
|
@@ -1,163 +1,286 @@
|
|
|
1
|
-
|
|
1
|
+
# Change Log
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## [2.9.0](https://github.com/chef/chef-vault/tree/2.9.0) (2016-04-06)
|
|
4
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.8.0...2.9.0)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
**Implemented enhancements:**
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
* ensure there are Aruba tests for all the subcommands and scenarios that match DEMO.md
|
|
9
|
-
* clean up any leftover Rubocop issues
|
|
8
|
+
- Feature - knife vault update - update item\_keys only when no value is provided [\#202](https://github.com/chef/chef-vault/pull/202) ([xakraz](https://github.com/xakraz))
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
**Fixed bugs:**
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
- knife vault refresh always updates the data bag item [\#193](https://github.com/chef/chef-vault/issues/193)
|
|
13
|
+
- Correct vault creation in solo mode [\#206](https://github.com/chef/chef-vault/pull/206) ([kamaradclimber](https://github.com/kamaradclimber))
|
|
14
|
+
- Only save keys on refresh operation [\#194](https://github.com/chef/chef-vault/pull/194) ([kamaradclimber](https://github.com/kamaradclimber))
|
|
16
15
|
|
|
17
|
-
##
|
|
16
|
+
## [v2.8.0](https://github.com/chef/chef-vault/tree/v2.8.0) (2016-02-09)
|
|
17
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.8.0.rc1...v2.8.0)
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
problem where a vault can't be encrypted for a node until the node has been
|
|
21
|
-
created. Exactly how we will do that is open to discussion (watch the
|
|
22
|
-
chef-vault issues on github for news).
|
|
19
|
+
**Merged pull requests:**
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
- UPGRADE: fixed a typo [\#198](https://github.com/chef/chef-vault/pull/198) ([joonas](https://github.com/joonas))
|
|
22
|
+
- adds link to Chef Vault blog post to README [\#197](https://github.com/chef/chef-vault/pull/197) ([nellshamrell](https://github.com/nellshamrell))
|
|
25
23
|
|
|
26
|
-
##
|
|
24
|
+
## [v2.8.0.rc1](https://github.com/chef/chef-vault/tree/v2.8.0.rc1) (2016-01-29)
|
|
25
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.7.1...v2.8.0.rc1)
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
**Merged pull requests:**
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
- Deal with more than 1000 nodes [\#196](https://github.com/chef/chef-vault/pull/196) ([thommay](https://github.com/thommay))
|
|
31
30
|
|
|
32
|
-
## v2.
|
|
31
|
+
## [v2.7.1](https://github.com/chef/chef-vault/tree/v2.7.1) (2016-01-25)
|
|
32
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.7.0...v2.7.1)
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
## [v2.7.0](https://github.com/chef/chef-vault/tree/v2.7.0) (2016-01-25)
|
|
35
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.6.1...v2.7.0)
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
**Fixed bugs:**
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
* allow Ruby 1.9.3 failures to not cause the overall build to fail on Travis
|
|
41
|
-
* switch to latest 2.0.x, 2.1.x, and 2.2.x releases of Ruby
|
|
42
|
-
* add --clean-unknown-clients switch to `knife vault refresh`
|
|
43
|
-
* as a side effect, `ChefVault::Item` now has a `#refresh` method which can be used to programatically perform the same operation as `knife vault refresh`
|
|
44
|
-
* enhance 'knife vault show VAULTNAME' (without an item name) to list the names of the items in the vault for parity with 'knife data bag show'
|
|
45
|
-
* add #raw_keys to ChefVault::Item that calls #keys on the underlying data bag item. We can't make ChefVault::Item work like a true hash without breaking the public API, but this at least makes it easier to get a list of keys
|
|
46
|
-
* allow ChefVault::Item.new and ChefVault::Item.load to specify an alternate node name and client key path. See the README for the use case this serves.
|
|
47
|
-
* added ChefVault::Item.vault? predicate that returns true if the item is a vault and false otherwise
|
|
48
|
-
* added ChefVault::Item.data_bag_item_type method that returns one of :normal, :encrypted or :vault
|
|
49
|
-
* added 'knife vault isvault VAULT ITEM' subcommand that exits 0 if the item is a vault and 1 if it is not
|
|
50
|
-
* added 'knife vault itemtype VAULT ITEM' subcommand that outputs 'normal', 'encrypted' or 'vault'
|
|
39
|
+
- Should warn/error when modifying 1.x items [\#52](https://github.com/chef/chef-vault/issues/52)
|
|
51
40
|
|
|
52
|
-
|
|
41
|
+
**Closed issues:**
|
|
53
42
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
- Support data\_bag\_path arrays [\#191](https://github.com/chef/chef-vault/issues/191)
|
|
44
|
+
- Refresh fails if no search expression is set [\#188](https://github.com/chef/chef-vault/issues/188)
|
|
45
|
+
- knife vault create is failing [\#187](https://github.com/chef/chef-vault/issues/187)
|
|
46
|
+
- Issues with knife bootstrap --bootstrap-vault-item [\#185](https://github.com/chef/chef-vault/issues/185)
|
|
47
|
+
- Can't create anything. [\#183](https://github.com/chef/chef-vault/issues/183)
|
|
48
|
+
- knife vault refresh broken - chefdk0.7.0/chef11.1.1 [\#182](https://github.com/chef/chef-vault/issues/182)
|
|
49
|
+
- Environment Permissions [\#181](https://github.com/chef/chef-vault/issues/181)
|
|
50
|
+
- Knife vault stopped working after chefdk & chef-client upgrade [\#180](https://github.com/chef/chef-vault/issues/180)
|
|
51
|
+
- Chef 12.4.0 breaks user patch [\#176](https://github.com/chef/chef-vault/issues/176)
|
|
52
|
+
- vault refresh broken with chef 12.4.0 [\#175](https://github.com/chef/chef-vault/issues/175)
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
**Merged pull requests:**
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
- Correctly handle an array of data\_bag paths [\#192](https://github.com/chef/chef-vault/pull/192) ([thommay](https://github.com/thommay))
|
|
57
|
+
- add recognition of 'name' in response [\#184](https://github.com/chef/chef-vault/pull/184) ([lhandl](https://github.com/lhandl))
|
|
58
|
+
- typo in THEORY.md [\#179](https://github.com/chef/chef-vault/pull/179) ([mindyor](https://github.com/mindyor))
|
|
59
|
+
- Detect when trying to manage a v1 vault [\#173](https://github.com/chef/chef-vault/pull/173) ([jf647](https://github.com/jf647))
|
|
65
60
|
|
|
66
|
-
## v2.
|
|
61
|
+
## [v2.6.1](https://github.com/chef/chef-vault/tree/v2.6.1) (2015-05-28)
|
|
62
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.6.0...v2.6.1)
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
* added aruba CLI testing framework (just for --clean option for now)
|
|
70
|
-
* add Ruby 2.0.x and 2.1.x to Travis platforms
|
|
64
|
+
**Closed issues:**
|
|
71
65
|
|
|
72
|
-
|
|
66
|
+
- Permission Issue - Missing Read Permission [\#171](https://github.com/chef/chef-vault/issues/171)
|
|
67
|
+
- undefined method `vault' for Chef::Resource::User [\#170](https://github.com/chef/chef-vault/issues/170)
|
|
68
|
+
- ChefVault::Item.refresh [\#168](https://github.com/chef/chef-vault/issues/168)
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
* Use node_name as a default admin
|
|
76
|
-
* Add DEMO for users
|
|
70
|
+
**Merged pull requests:**
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
- Only load the parts of chef we actually use [\#172](https://github.com/chef/chef-vault/pull/172) ([danielsdeleo](https://github.com/danielsdeleo))
|
|
73
|
+
- Remove dependency on rspec-its gem [\#169](https://github.com/chef/chef-vault/pull/169) ([dougireton](https://github.com/dougireton))
|
|
74
|
+
- Add gitter.im [\#167](https://github.com/chef/chef-vault/pull/167) ([jf647](https://github.com/jf647))
|
|
79
75
|
|
|
80
|
-
|
|
76
|
+
## [v2.6.0](https://github.com/chef/chef-vault/tree/v2.6.0) (2015-05-13)
|
|
77
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.5.0...v2.6.0)
|
|
81
78
|
|
|
82
|
-
|
|
79
|
+
**Implemented enhancements:**
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* Add mode option for knife.rb
|
|
92
|
-
* Fix more README typos
|
|
81
|
+
- `ChefVault::Item` should not define `\#keys` method. [\#158](https://github.com/chef/chef-vault/issues/158)
|
|
82
|
+
- Add --clean to refresh option [\#151](https://github.com/chef/chef-vault/issues/151)
|
|
83
|
+
- Allow clients \(without a node\) to be returned via searches. [\#150](https://github.com/chef/chef-vault/issues/150)
|
|
84
|
+
- Need validation for item id: property [\#149](https://github.com/chef/chef-vault/issues/149)
|
|
85
|
+
- Add helper to get the keys of a vault item [\#142](https://github.com/chef/chef-vault/issues/142)
|
|
86
|
+
- Add knife vault show vaultname [\#141](https://github.com/chef/chef-vault/issues/141)
|
|
87
|
+
- Knife Vault Refresh Not Running on Server 2012R2 [\#129](https://github.com/chef/chef-vault/issues/129)
|
|
93
88
|
|
|
94
|
-
|
|
89
|
+
**Closed issues:**
|
|
95
90
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
- knife vault create examples using node/client names? [\#157](https://github.com/chef/chef-vault/issues/157)
|
|
92
|
+
- Unable to create a chef vault secret from a recipe [\#154](https://github.com/chef/chef-vault/issues/154)
|
|
93
|
+
- knife boostrap not picking up nodes from search query of vaults [\#148](https://github.com/chef/chef-vault/issues/148)
|
|
94
|
+
- Cannot update vault item [\#116](https://github.com/chef/chef-vault/issues/116)
|
|
95
|
+
- Refresh did not re-encrypt for an admin's new key [\#145](https://github.com/chef/chef-vault/issues/145)
|
|
96
|
+
- Chef 12.1.0 warning [\#143](https://github.com/chef/chef-vault/issues/143)
|
|
100
97
|
|
|
101
|
-
|
|
98
|
+
**Merged pull requests:**
|
|
102
99
|
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
- Add vault probing predicates [\#165](https://github.com/chef/chef-vault/pull/165) ([jf647](https://github.com/jf647))
|
|
101
|
+
- Allow the node name and path to the client key to be specified [\#163](https://github.com/chef/chef-vault/pull/163) ([jf647](https://github.com/jf647))
|
|
102
|
+
- Add a \#raw\_keys method to ChefVault::Item [\#162](https://github.com/chef/chef-vault/pull/162) ([jf647](https://github.com/jf647))
|
|
103
|
+
- Enhance 'knife vault show' to list vault items [\#161](https://github.com/chef/chef-vault/pull/161) ([jf647](https://github.com/jf647))
|
|
104
|
+
- Validate that the vault id hasn't changed since the \_keys item was created [\#160](https://github.com/chef/chef-vault/pull/160) ([jf647](https://github.com/jf647))
|
|
105
|
+
- Add --clean-unknown-clients to 'knife vault refresh' [\#159](https://github.com/chef/chef-vault/pull/159) ([jf647](https://github.com/jf647))
|
|
106
|
+
- Let ChefVault::Item\#clients accept a Chef::ApiClient instead of a search... [\#156](https://github.com/chef/chef-vault/pull/156) ([jf647](https://github.com/jf647))
|
|
107
|
+
- Allow ruby 1.9.3 to fail on Travis [\#155](https://github.com/chef/chef-vault/pull/155) ([jf647](https://github.com/jf647))
|
|
108
|
+
- Update docs to reflect the new compile\_time attribute of chef\_gem [\#144](https://github.com/chef/chef-vault/pull/144) ([jf647](https://github.com/jf647))
|
|
109
|
+
- very minor correction to typo [\#139](https://github.com/chef/chef-vault/pull/139) ([Dispader](https://github.com/Dispader))
|
|
110
|
+
- Release 2.6.0 [\#164](https://github.com/chef/chef-vault/pull/164) ([jf647](https://github.com/jf647))
|
|
105
111
|
|
|
106
|
-
## v2.0.
|
|
112
|
+
## [v2.5.0](https://github.com/chef/chef-vault/tree/v2.5.0) (2015-02-09)
|
|
113
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.4.0...v2.5.0)
|
|
107
114
|
|
|
108
|
-
|
|
109
|
-
* Removal of knife encrypt passwords
|
|
110
|
-
* Add knife encrypt create
|
|
111
|
-
* Add knife encrypt update
|
|
112
|
-
* Add knife encrypt remove
|
|
113
|
-
* Add knife encrypt delete
|
|
114
|
-
* Add knife encrypt rotate keys
|
|
115
|
-
* Add knife decrypt
|
|
116
|
-
* Update chef-vault binary to take -v, -i, -a
|
|
117
|
-
* Add ChefVault::Item class
|
|
118
|
-
* Add ChefVault::ItemKeys class
|
|
119
|
-
* Modify ChefVault::User to use ChefVault::Item to maintain backwards compatability
|
|
120
|
-
* Modify ChefVault::Certificate to use ChefVault::Item to maintain backwards compatability
|
|
115
|
+
**Implemented enhancements:**
|
|
121
116
|
|
|
122
|
-
|
|
117
|
+
- knife vault list [\#97](https://github.com/chef/chef-vault/issues/97)
|
|
118
|
+
- Add chef-vault.bat to bin for windows users [\#60](https://github.com/chef/chef-vault/issues/60)
|
|
119
|
+
- OpenSSL error if private key does not match used public key [\#43](https://github.com/chef/chef-vault/issues/43)
|
|
120
|
+
- Skip missing/invalid client rather than raising exception [\#127](https://github.com/chef/chef-vault/issues/127)
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
* Allow nodes/clients to be used as Admins
|
|
122
|
+
**Fixed bugs:**
|
|
126
123
|
|
|
127
|
-
|
|
124
|
+
- 2.4.0 was not tagged in github [\#128](https://github.com/chef/chef-vault/issues/128)
|
|
125
|
+
- clean\_unknown\_clients not working [\#133](https://github.com/chef/chef-vault/issues/133)
|
|
126
|
+
- Skip missing/invalid client rather than raising exception [\#127](https://github.com/chef/chef-vault/issues/127)
|
|
128
127
|
|
|
129
|
-
|
|
130
|
-
* Modify open file commands in knife commands to avoid file locking on windows
|
|
128
|
+
**Closed issues:**
|
|
131
129
|
|
|
132
|
-
|
|
130
|
+
- Support pruning of deleted clients from vault access list when rotating keys [\#123](https://github.com/chef/chef-vault/issues/123)
|
|
131
|
+
- knife subcommands fail in cryptic fashion if you don't set --mode [\#117](https://github.com/chef/chef-vault/issues/117)
|
|
132
|
+
- vault commands force -A or knife.rb :vault\_admins [\#89](https://github.com/chef/chef-vault/issues/89)
|
|
133
|
+
- Add RSpec tests for chef-vault/chef/offline.rb [\#13](https://github.com/chef/chef-vault/issues/13)
|
|
134
|
+
- Need theory of operations/architecture documentation [\#109](https://github.com/chef/chef-vault/issues/109)
|
|
133
135
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
## [v2.4.0](https://github.com/chef/chef-vault/tree/v2.4.0) (2014-12-03)
|
|
137
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.3.0...v2.4.0)
|
|
136
138
|
|
|
137
|
-
|
|
139
|
+
**Closed issues:**
|
|
138
140
|
|
|
139
|
-
|
|
141
|
+
- Create, Refresh and Update behaviours [\#118](https://github.com/chef/chef-vault/issues/118)
|
|
142
|
+
- vault refresh remove clients from keys data bag? [\#111](https://github.com/chef/chef-vault/issues/111)
|
|
143
|
+
- There doesnt seem to be a way to remove authorized client from vault\_keys [\#103](https://github.com/chef/chef-vault/issues/103)
|
|
144
|
+
|
|
145
|
+
**Merged pull requests:**
|
|
146
|
+
|
|
147
|
+
- Upgrade to RSpec 3.1 and disable monkey-patching [\#122](https://github.com/chef/chef-vault/pull/122) ([dougireton](https://github.com/dougireton))
|
|
140
148
|
|
|
141
|
-
##
|
|
149
|
+
## [v2.3.0](https://github.com/chef/chef-vault/tree/v2.3.0) (2014-10-22)
|
|
150
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.2.4...v2.3.0)
|
|
142
151
|
|
|
143
|
-
|
|
152
|
+
**Closed issues:**
|
|
144
153
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
154
|
+
- Please push missing tags \(especially \> 2.2.1\) [\#119](https://github.com/chef/chef-vault/issues/119)
|
|
155
|
+
- Vault subcommands not showing for knife [\#114](https://github.com/chef/chef-vault/issues/114)
|
|
156
|
+
- cannot get client public\_key [\#113](https://github.com/chef/chef-vault/issues/113)
|
|
157
|
+
- Key update methods [\#105](https://github.com/chef/chef-vault/issues/105)
|
|
158
|
+
|
|
159
|
+
**Merged pull requests:**
|
|
160
|
+
|
|
161
|
+
- Add a knife vault download command for downloading encrypted files [\#104](https://github.com/chef/chef-vault/pull/104) ([justinlocsei](https://github.com/justinlocsei))
|
|
162
|
+
|
|
163
|
+
## [v2.2.4](https://github.com/chef/chef-vault/tree/v2.2.4) (2014-07-17)
|
|
164
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.2.3...v2.2.4)
|
|
165
|
+
|
|
166
|
+
**Closed issues:**
|
|
167
|
+
|
|
168
|
+
- Improvement: easier way to update stored search for an item [\#110](https://github.com/chef/chef-vault/issues/110)
|
|
169
|
+
- Missing refresh command [\#106](https://github.com/chef/chef-vault/issues/106)
|
|
170
|
+
- Add RSpec tests for chef-vault/certificate.rb [\#12](https://github.com/chef/chef-vault/issues/12)
|
|
171
|
+
- Add RSpec tests for chef-vault/user.rb [\#11](https://github.com/chef/chef-vault/issues/11)
|
|
172
|
+
|
|
173
|
+
**Merged pull requests:**
|
|
174
|
+
|
|
175
|
+
- Improved tests [\#112](https://github.com/chef/chef-vault/pull/112) ([rastasheep](https://github.com/rastasheep))
|
|
176
|
+
|
|
177
|
+
## [v2.2.3](https://github.com/chef/chef-vault/tree/v2.2.3) (2014-06-24)
|
|
178
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.2.2...v2.2.3)
|
|
179
|
+
|
|
180
|
+
## [v2.2.2](https://github.com/chef/chef-vault/tree/v2.2.2) (2014-06-03)
|
|
181
|
+
[Full Changelog](https://github.com/chef/chef-vault/compare/v2.2.1...v2.2.2)
|
|
182
|
+
|
|
183
|
+
**Closed issues:**
|
|
184
|
+
|
|
185
|
+
- cannot load such file -- chef/user [\#102](https://github.com/chef/chef-vault/issues/102)
|
|
186
|
+
- Reapply Search [\#95](https://github.com/chef/chef-vault/issues/95)
|
|
187
|
+
- knife vault create thows "can't convert Array into String \(TypeError\)" [\#94](https://github.com/chef/chef-vault/issues/94)
|
|
188
|
+
- ChefVault::Exceptions::KeysNotFound in test kitchen [\#92](https://github.com/chef/chef-vault/issues/92)
|
|
189
|
+
- Undefined method join for nil class [\#91](https://github.com/chef/chef-vault/issues/91)
|
|
190
|
+
- Purpose of `rotate keys` [\#90](https://github.com/chef/chef-vault/issues/90)
|
|
191
|
+
|
|
192
|
+
**Merged pull requests:**
|
|
193
|
+
|
|
194
|
+
- Add gem\_tasks to Rakefile so you can do `rake release` [\#98](https://github.com/chef/chef-vault/pull/98) ([dougireton](https://github.com/dougireton))
|
|
195
|
+
- Fixes \#95 - Adding reapply command [\#96](https://github.com/chef/chef-vault/pull/96) ([pdalinis](https://github.com/pdalinis))
|
|
196
|
+
- knife.rb node name is default admin [\#93](https://github.com/chef/chef-vault/pull/93) ([jgeiger](https://github.com/jgeiger))
|
|
197
|
+
- Fixed minor formatting in README to allow the vault\_admins info to display properly. [\#88](https://github.com/chef/chef-vault/pull/88) ([eklein](https://github.com/eklein))
|
|
198
|
+
- Add a short demo as an easy way in [\#87](https://github.com/chef/chef-vault/pull/87) ([aug24](https://github.com/aug24))
|
|
199
|
+
|
|
200
|
+
## [v2.2.1](https://github.com/chef/chef-vault/tree/v2.2.1) (2014-02-26)
|
|
201
|
+
**Implemented enhancements:**
|
|
202
|
+
|
|
203
|
+
- Add a file-content option to the knife commands [\#42](https://github.com/chef/chef-vault/issues/42)
|
|
204
|
+
- Rotate shared secret when you remove nodes or admins [\#38](https://github.com/chef/chef-vault/issues/38)
|
|
205
|
+
|
|
206
|
+
**Fixed bugs:**
|
|
207
|
+
|
|
208
|
+
- Fix broken travis ci badge [\#32](https://github.com/chef/chef-vault/issues/32)
|
|
209
|
+
|
|
210
|
+
**Closed issues:**
|
|
211
|
+
|
|
212
|
+
- A question about keys. [\#85](https://github.com/chef/chef-vault/issues/85)
|
|
213
|
+
- --ADMINS option must be declared as mandatory when creating vault item [\#83](https://github.com/chef/chef-vault/issues/83)
|
|
214
|
+
- Vault UPDATE fails when vault item is created without any ADMINS specified [\#81](https://github.com/chef/chef-vault/issues/81)
|
|
215
|
+
- Changelog.md has a typo in "Released" date of version "v2.2.0" [\#79](https://github.com/chef/chef-vault/issues/79)
|
|
216
|
+
- Release updated gem to rubygems [\#78](https://github.com/chef/chef-vault/issues/78)
|
|
217
|
+
- knife encrypt allows illegal characters in dabag item ID [\#75](https://github.com/chef/chef-vault/issues/75)
|
|
218
|
+
- knife encrypt should store the search query [\#66](https://github.com/chef/chef-vault/issues/66)
|
|
219
|
+
- Allow for printing standard knife formatted output of the entire chef-vault'ed databag [\#62](https://github.com/chef/chef-vault/issues/62)
|
|
220
|
+
- Is there a way to test recipes using ChefVault with test-kitchen? [\#61](https://github.com/chef/chef-vault/issues/61)
|
|
221
|
+
- When is 2.1.0 scheduled for release? [\#59](https://github.com/chef/chef-vault/issues/59)
|
|
222
|
+
- Getting gem load error on windows 2012 chef solo client. [\#57](https://github.com/chef/chef-vault/issues/57)
|
|
223
|
+
- Typo in readme [\#55](https://github.com/chef/chef-vault/issues/55)
|
|
224
|
+
- JSON::ParserError: Unsupported `json\_class` type 'Chef::WebUIUser' [\#54](https://github.com/chef/chef-vault/issues/54)
|
|
225
|
+
- Improve knife commands and order [\#51](https://github.com/chef/chef-vault/issues/51)
|
|
226
|
+
- decrypt should emit json for the entire item [\#50](https://github.com/chef/chef-vault/issues/50)
|
|
227
|
+
- Use a larger key size for the generated secret by default, and allow keysize setting [\#46](https://github.com/chef/chef-vault/issues/46)
|
|
228
|
+
- Usage text is incorrect for `knife encrypt rotate keys` [\#44](https://github.com/chef/chef-vault/issues/44)
|
|
229
|
+
- Solo mode does not create knife data bag from file valid data bag file [\#40](https://github.com/chef/chef-vault/issues/40)
|
|
230
|
+
- ERROR: ChefVault::Exceptions::AdminNotFound for client admins [\#39](https://github.com/chef/chef-vault/issues/39)
|
|
231
|
+
- Warn when knife encrypt --search returns zero results [\#31](https://github.com/chef/chef-vault/issues/31)
|
|
232
|
+
- Clarify that knife encrypt creates databag and data bag items [\#30](https://github.com/chef/chef-vault/issues/30)
|
|
233
|
+
- Titlecase "chef" in README [\#29](https://github.com/chef/chef-vault/issues/29)
|
|
234
|
+
- knife dumps stack trace with Chef 10.24.0 after installing chef-vault gem [\#27](https://github.com/chef/chef-vault/issues/27)
|
|
235
|
+
- Remove Gemfile.lock from repo per Yehuda Katz and add dev dependencies to Gemspec [\#23](https://github.com/chef/chef-vault/issues/23)
|
|
236
|
+
- Setup project to run with Travis CI [\#18](https://github.com/chef/chef-vault/issues/18)
|
|
237
|
+
- Create Rake file to run tests [\#17](https://github.com/chef/chef-vault/issues/17)
|
|
238
|
+
- Add LICENSE file [\#16](https://github.com/chef/chef-vault/issues/16)
|
|
239
|
+
- Add Contributing guidelines [\#15](https://github.com/chef/chef-vault/issues/15)
|
|
240
|
+
- Add changelog [\#14](https://github.com/chef/chef-vault/issues/14)
|
|
241
|
+
- In `chef-vault.rb`, use data\_bag and chef\_config\_file getters instead of instance vars per POODR guidelines [\#9](https://github.com/chef/chef-vault/issues/9)
|
|
242
|
+
- Add RSpec tests for lib/chef-vault.rb [\#7](https://github.com/chef/chef-vault/issues/7)
|
|
243
|
+
- Splitting `admins` var on comma leaves in extraneous whitespace when --admins has spaces [\#5](https://github.com/chef/chef-vault/issues/5)
|
|
244
|
+
- Show better error message when 'certs' or 'passwords' directory is missing from chef-repo/databags/ directory [\#4](https://github.com/chef/chef-vault/issues/4)
|
|
245
|
+
- Readme should be clarified [\#1](https://github.com/chef/chef-vault/issues/1)
|
|
246
|
+
|
|
247
|
+
**Merged pull requests:**
|
|
248
|
+
|
|
249
|
+
- Add ability to use default administrators [\#84](https://github.com/chef/chef-vault/pull/84) ([dafyddcrosby](https://github.com/dafyddcrosby))
|
|
250
|
+
- Wrong year for recent update [\#82](https://github.com/chef/chef-vault/pull/82) ([lamont](https://github.com/lamont))
|
|
251
|
+
- Fixes \#79: "Released" date of version "v2.2.0" [\#80](https://github.com/chef/chef-vault/pull/80) ([techish1](https://github.com/techish1))
|
|
252
|
+
- Validate ID before saving item [\#77](https://github.com/chef/chef-vault/pull/77) ([eklein](https://github.com/eklein))
|
|
253
|
+
- Store search query & print vault admin data [\#74](https://github.com/chef/chef-vault/pull/74) ([eklein](https://github.com/eklein))
|
|
254
|
+
- Missed replacing "decrypt" w/ "show" in README.md [\#73](https://github.com/chef/chef-vault/pull/73) ([eklein](https://github.com/eklein))
|
|
255
|
+
- Rebased PR on top of jgeiger's merged PR [\#72](https://github.com/chef/chef-vault/pull/72) ([eklein](https://github.com/eklein))
|
|
256
|
+
- Add vault commands, deprecate encrypt, add rotate all keys [\#71](https://github.com/chef/chef-vault/pull/71) ([jgeiger](https://github.com/jgeiger))
|
|
257
|
+
- Fix github user name for repository [\#70](https://github.com/chef/chef-vault/pull/70) ([jgeiger](https://github.com/jgeiger))
|
|
258
|
+
- Fix \#51: update knife commands [\#68](https://github.com/chef/chef-vault/pull/68) ([jgeiger](https://github.com/jgeiger))
|
|
259
|
+
- Fix typos in KNIFE\_EXAMPLES.md [\#67](https://github.com/chef/chef-vault/pull/67) ([jgeiger](https://github.com/jgeiger))
|
|
260
|
+
- Issue 50: Use standard chef/knife formatting for all knife decrypt output [\#64](https://github.com/chef/chef-vault/pull/64) ([eklein](https://github.com/eklein))
|
|
261
|
+
- Issue \#62: Allow for printing entire chef-vault'ed databag [\#63](https://github.com/chef/chef-vault/pull/63) ([eklein](https://github.com/eklein))
|
|
262
|
+
- Fixes \#56: Typo in readme [\#56](https://github.com/chef/chef-vault/pull/56) ([bhicks](https://github.com/bhicks))
|
|
263
|
+
- Addresses \#46, use securerandom to generate secret [\#48](https://github.com/chef/chef-vault/pull/48) ([jtimberman](https://github.com/jtimberman))
|
|
264
|
+
- Fixes \#44: Usage text is incorrect for `knife encrypt rotate keys` [\#45](https://github.com/chef/chef-vault/pull/45) ([jer](https://github.com/jer))
|
|
265
|
+
- Fixing typo in command line option and README: vaules -\> values [\#41](https://github.com/chef/chef-vault/pull/41) ([trinitronx](https://github.com/trinitronx))
|
|
266
|
+
- Fix: open locked file on windows during data\_bag update [\#37](https://github.com/chef/chef-vault/pull/37) ([aseresun](https://github.com/aseresun))
|
|
267
|
+
- Allow any client key to act as admin [\#36](https://github.com/chef/chef-vault/pull/36) ([kisoku](https://github.com/kisoku))
|
|
268
|
+
- move the compat include into the lazy-load [\#35](https://github.com/chef/chef-vault/pull/35) ([spheromak](https://github.com/spheromak))
|
|
269
|
+
- Fix \#32: Correct Travis CI link [\#34](https://github.com/chef/chef-vault/pull/34) ([dougireton](https://github.com/dougireton))
|
|
270
|
+
- Fix \#32: Fix broken travis ci badge [\#33](https://github.com/chef/chef-vault/pull/33) ([dougireton](https://github.com/dougireton))
|
|
271
|
+
- Add Version Badge to Readme [\#26](https://github.com/chef/chef-vault/pull/26) ([dougireton](https://github.com/dougireton))
|
|
272
|
+
- Fixes \#18: Add .travis.yml file [\#25](https://github.com/chef/chef-vault/pull/25) ([dougireton](https://github.com/dougireton))
|
|
273
|
+
- Fixes \#23: Remove Gemfile.lock from repo per Yehuda Katz [\#24](https://github.com/chef/chef-vault/pull/24) ([dougireton](https://github.com/dougireton))
|
|
274
|
+
- Fixes \#15: Add Contributing guide [\#22](https://github.com/chef/chef-vault/pull/22) ([dougireton](https://github.com/dougireton))
|
|
275
|
+
- Fixes \#14: Add initial Changelog [\#21](https://github.com/chef/chef-vault/pull/21) ([dougireton](https://github.com/dougireton))
|
|
276
|
+
- Fixes \#16: Add Apache 2.0 license file and source headers [\#20](https://github.com/chef/chef-vault/pull/20) ([dougireton](https://github.com/dougireton))
|
|
277
|
+
- Fixes \#17: Add initial Rakefile to run specs [\#19](https://github.com/chef/chef-vault/pull/19) ([dougireton](https://github.com/dougireton))
|
|
278
|
+
- Fixes \#9: Use getters instead of instance vars [\#10](https://github.com/chef/chef-vault/pull/10) ([dougireton](https://github.com/dougireton))
|
|
279
|
+
- Fixes \#7: Add rspec tests for chef-vault.rb [\#8](https://github.com/chef/chef-vault/pull/8) ([dougireton](https://github.com/dougireton))
|
|
280
|
+
- Fixes \#2: Split --admins string on ',' and whitespace [\#6](https://github.com/chef/chef-vault/pull/6) ([dougireton](https://github.com/dougireton))
|
|
281
|
+
- Update for compatability with chef10/11 [\#3](https://github.com/chef/chef-vault/pull/3) ([spheromak](https://github.com/spheromak))
|
|
282
|
+
- Fixes \#1: Clarify readme [\#2](https://github.com/chef/chef-vault/pull/2) ([dougireton](https://github.com/dougireton))
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
source "https://rubygems.org/"
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
group :development do
|
|
4
|
+
gem "chefstyle", git: "https://github.com/chef/chefstyle.git"
|
|
5
|
+
end
|
|
6
|
+
if RUBY_VERSION.to_f >= 2.0
|
|
7
|
+
group :changelog do
|
|
8
|
+
gem "github_changelog_generator", "1.11.3"
|
|
9
|
+
end
|
|
10
|
+
end
|
|
4
11
|
|
|
5
12
|
gemspec
|
data/Rakefile
CHANGED
data/bin/chef-vault
CHANGED
|
@@ -75,7 +75,7 @@ OptionParser.new do |opts|
|
|
|
75
75
|
end.parse!
|
|
76
76
|
|
|
77
77
|
options_config.each do |option, config|
|
|
78
|
-
raise OptionParser::MissingArgument, option if
|
|
78
|
+
raise OptionParser::MissingArgument, option if options[option].nil? && !config[:optional]
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
options_config.each do |option, config|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Feature: Detect and Warn for v1 Vaults
|
|
2
2
|
|
|
3
3
|
chef-vault can read a v1 vault, but the management commands
|
|
4
|
-
tend to break when they try to
|
|
4
|
+
tend to break when they try to reference v2 fields like
|
|
5
5
|
clients and admins. They should detect and warn when trying
|
|
6
6
|
to access a v1 vault
|
|
7
7
|
|
|
8
8
|
Scenario: Add search query to v1 vault
|
|
9
|
-
Given a local mode chef repo with nodes 'one,two,three'
|
|
9
|
+
Given a local mode chef repo with nodes 'one,two,three' with admins 'bob'
|
|
10
10
|
And I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two,three'
|
|
11
11
|
Then the vault item 'test/item' should be encrypted for 'one,two,three'
|
|
12
12
|
And 'one,two,three' should be a client for the vault item 'test/item'
|
|
@@ -8,6 +8,7 @@ Given(/^a local mode chef repo with nodes '(.+?)'(?: with admins '(.+?)')?$/) do
|
|
|
8
8
|
local_mode true
|
|
9
9
|
chef_repo_path '.'
|
|
10
10
|
chef_zero.enabled true
|
|
11
|
+
knife[:vault_mode] = 'client'
|
|
11
12
|
EOF
|
|
12
13
|
# create the admin users and capture their private key we
|
|
13
14
|
# always create an admin called 'admin' because otherwise subsequent
|
|
@@ -119,6 +119,22 @@ Given(/^I downgrade the vault item '(.+)\/(.+)' to v1 syntax/) do |vault, item|
|
|
|
119
119
|
# v1 syntax doesn't have the admins, clients and search_query keys
|
|
120
120
|
keysfile = "tmp/aruba/data_bags/#{vault}/#{item}_keys.json"
|
|
121
121
|
data = JSON.parse(IO.read(keysfile))
|
|
122
|
-
%w{admins clients search_query}.each { |k| data.delete(k) }
|
|
122
|
+
%w{admins clients search_query}.each { |k| data.key?("raw_data") ? data["raw_data"].delete(k) : data.delete(k) }
|
|
123
123
|
IO.write(keysfile, JSON.generate(data))
|
|
124
124
|
end
|
|
125
|
+
|
|
126
|
+
Given(/^I can save the JSON object of the encrypted data bag for the vault item '(.+)\/(.+)'$/) do |vault, item|
|
|
127
|
+
command = "knife data bag show #{vault} #{item} -z -c knife.rb -F json"
|
|
128
|
+
run_simple(command)
|
|
129
|
+
output = last_command_started.stdout
|
|
130
|
+
@saved_encrypted_vault_item = JSON.parse(output)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
Given(/^the data bag of the vault item '(.+)\/(.+)' has not been re-encrypted$/) do |vault, item|
|
|
134
|
+
command = "knife data bag show #{vault} #{item} -z -c knife.rb -F json"
|
|
135
|
+
run_simple(command)
|
|
136
|
+
output = last_command_started.stdout
|
|
137
|
+
encrypted_vault_item = JSON.parse(output)
|
|
138
|
+
|
|
139
|
+
expect(encrypted_vault_item).to eq(@saved_encrypted_vault_item)
|
|
140
|
+
end
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
Feature: knife vault update
|
|
2
2
|
|
|
3
3
|
'knife vault update' is used to add clients, or administrators
|
|
4
|
-
and to re-run the search query
|
|
4
|
+
and to re-run the search query and update the vault's item values.
|
|
5
5
|
|
|
6
6
|
Scenario: add admin to a vault
|
|
7
7
|
Given a local mode chef repo with nodes 'one,two,three' with admins 'alice,bob'
|
|
8
|
-
|
|
8
|
+
When I create a vault item 'test/item' containing the JSON '{"foo": "bar"}' encrypted for 'one,two,three' with 'alice' as admin
|
|
9
9
|
Then the vault item 'test/item' should be encrypted for 'one,two,three'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
And 'one,two,three' should be a client for the vault item 'test/item'
|
|
11
|
+
And 'alice' should be an admin for the vault item 'test/item'
|
|
12
|
+
And I can decrypt the vault item 'test/item' as 'alice'
|
|
13
|
+
But I can't decrypt the vault item 'test/item' as 'bob'
|
|
14
|
+
And I can save the JSON object of the encrypted data bag for the vault item 'test/item'
|
|
15
|
+
When I add 'bob' as an admin for the vault item 'test/item'
|
|
15
16
|
Then 'alice,bob' should be an admin for the vault item 'test/item'
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
And I can decrypt the vault item 'test/item' as 'alice'
|
|
18
|
+
And I can decrypt the vault item 'test/item' as 'bob'
|
|
19
|
+
And the data bag of the vault item 'test/item' has not been re-encrypted
|
data/lib/chef-vault/item.rb
CHANGED
|
@@ -196,25 +196,7 @@ class ChefVault
|
|
|
196
196
|
end
|
|
197
197
|
|
|
198
198
|
def save(item_id = @raw_data["id"])
|
|
199
|
-
|
|
200
|
-
validate_id!(item_id)
|
|
201
|
-
|
|
202
|
-
# ensure that the ID of the vault hasn't changed since the keys
|
|
203
|
-
# data bag item was created
|
|
204
|
-
keys_id = keys["id"].match(/^(.+)_keys/)[1]
|
|
205
|
-
if keys_id != item_id
|
|
206
|
-
raise ChefVault::Exceptions::IdMismatch,
|
|
207
|
-
"id mismatch - input JSON has id '#{item_id}' but vault item has id '#{keys_id}'"
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
# save the keys first, raising an error if no keys were defined
|
|
211
|
-
if keys.admins.empty? && keys.clients.empty?
|
|
212
|
-
raise ChefVault::Exceptions::NoKeysDefined,
|
|
213
|
-
"No keys defined for #{item_id}"
|
|
214
|
-
end
|
|
215
|
-
|
|
216
|
-
keys.save
|
|
217
|
-
|
|
199
|
+
save_keys(item_id)
|
|
218
200
|
# Make sure the item is encrypted before saving
|
|
219
201
|
encrypt! unless @encrypted
|
|
220
202
|
|
|
@@ -236,6 +218,27 @@ class ChefVault
|
|
|
236
218
|
end
|
|
237
219
|
end
|
|
238
220
|
|
|
221
|
+
def save_keys(item_id = @raw_data["id"])
|
|
222
|
+
# validate the format of the id before attempting to save
|
|
223
|
+
validate_id!(item_id)
|
|
224
|
+
|
|
225
|
+
# ensure that the ID of the vault hasn't changed since the keys
|
|
226
|
+
# data bag item was created
|
|
227
|
+
keys_id = keys["id"].match(/^(.+)_keys/)[1]
|
|
228
|
+
if keys_id != item_id
|
|
229
|
+
raise ChefVault::Exceptions::IdMismatch,
|
|
230
|
+
"id mismatch - input JSON has id '#{item_id}' but vault item has id '#{keys_id}'"
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# save the keys first, raising an error if no keys were defined
|
|
234
|
+
if keys.admins.empty? && keys.clients.empty?
|
|
235
|
+
raise ChefVault::Exceptions::NoKeysDefined,
|
|
236
|
+
"No keys defined for #{item_id}"
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
keys.save
|
|
240
|
+
end
|
|
241
|
+
|
|
239
242
|
def to_json(*a)
|
|
240
243
|
json = super
|
|
241
244
|
json.gsub(self.class.name, self.class.superclass.name)
|
|
@@ -346,8 +349,8 @@ class ChefVault
|
|
|
346
349
|
# re-process the search query to add new clients
|
|
347
350
|
clients(search)
|
|
348
351
|
|
|
349
|
-
# save the updated
|
|
350
|
-
|
|
352
|
+
# save the updated keys only
|
|
353
|
+
save_keys(@raw_data["id"])
|
|
351
354
|
end
|
|
352
355
|
|
|
353
356
|
private
|
data/lib/chef-vault/version.rb
CHANGED
|
@@ -61,7 +61,8 @@ class Chef
|
|
|
61
61
|
"use 'knife vault remove' 'knife vault update' "\
|
|
62
62
|
"or 'knife vault edit' to make changes."
|
|
63
63
|
rescue ChefVault::Exceptions::KeysNotFound,
|
|
64
|
-
ChefVault::Exceptions::ItemNotFound
|
|
64
|
+
ChefVault::Exceptions::ItemNotFound,
|
|
65
|
+
Chef::Exceptions::InvalidDataBagItemID
|
|
65
66
|
vault_item = ChefVault::Item.new(vault, item)
|
|
66
67
|
if values || json_file || file
|
|
67
68
|
merge_values(values, json_file).each do |key, value|
|
|
@@ -62,15 +62,7 @@ class Chef
|
|
|
62
62
|
begin
|
|
63
63
|
vault_item = ChefVault::Item.load(vault, item)
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
vault_item[key] = value
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
if file
|
|
70
|
-
vault_item["file-name"] = File.basename(file)
|
|
71
|
-
vault_item["file-content"] = File.open(file) { |f| f.read() }
|
|
72
|
-
end
|
|
73
|
-
|
|
65
|
+
# Keys management first
|
|
74
66
|
if clean
|
|
75
67
|
clients = vault_item.clients().clone().sort()
|
|
76
68
|
clients.each do |client|
|
|
@@ -78,11 +70,27 @@ class Chef
|
|
|
78
70
|
vault_item.keys.delete(client, "clients")
|
|
79
71
|
end
|
|
80
72
|
end
|
|
73
|
+
|
|
81
74
|
vault_item.search(search) if search
|
|
82
75
|
vault_item.clients(search) if search
|
|
83
76
|
vault_item.admins(admins) if admins
|
|
84
77
|
|
|
85
|
-
|
|
78
|
+
# Save only the keys if no value is provided, otherwise save the item
|
|
79
|
+
if values || json_file || file
|
|
80
|
+
merge_values(values, json_file).each do |key, value|
|
|
81
|
+
vault_item[key] = value
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if file
|
|
85
|
+
vault_item["file-name"] = File.basename(file)
|
|
86
|
+
vault_item["file-content"] = File.open(file) { |f| f.read() }
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
vault_item.save
|
|
90
|
+
else
|
|
91
|
+
vault_item.save_keys
|
|
92
|
+
end
|
|
93
|
+
|
|
86
94
|
rescue ChefVault::Exceptions::KeysNotFound,
|
|
87
95
|
ChefVault::Exceptions::ItemNotFound
|
|
88
96
|
raise ChefVault::Exceptions::ItemNotFound,
|
|
@@ -198,7 +198,7 @@ RSpec.describe ChefVault::Item do
|
|
|
198
198
|
allow(OpenSSL::PKey::RSA).to receive(:new).and_return(privkey)
|
|
199
199
|
allow(Chef::EncryptedDataBagItem).to receive(:load).and_return(
|
|
200
200
|
"id" => "bar",
|
|
201
|
-
"password" => "12345"
|
|
201
|
+
"password" => "12345"
|
|
202
202
|
)
|
|
203
203
|
item = ChefVault::Item.load(
|
|
204
204
|
"foo", "bar",
|
|
@@ -227,6 +227,35 @@ RSpec.describe ChefVault::Item do
|
|
|
227
227
|
end
|
|
228
228
|
end
|
|
229
229
|
|
|
230
|
+
describe '#refresh' do
|
|
231
|
+
|
|
232
|
+
it "saves only the keys" do
|
|
233
|
+
keys = double("keys",
|
|
234
|
+
search_query: "*:*",
|
|
235
|
+
add: nil,
|
|
236
|
+
admins: [],
|
|
237
|
+
clients: ["testnode"])
|
|
238
|
+
allow(keys).to receive(:[]).with("id").and_return("bar_keys")
|
|
239
|
+
allow(ChefVault::ItemKeys).to receive(:new).and_return(keys)
|
|
240
|
+
|
|
241
|
+
item = ChefVault::Item.new("foo", "bar")
|
|
242
|
+
|
|
243
|
+
node = double("node", name: "testnode")
|
|
244
|
+
query = double("query")
|
|
245
|
+
allow(Chef::Search::Query).to receive(:new).and_return(query)
|
|
246
|
+
allow(query).to receive(:search).and_yield(node)
|
|
247
|
+
|
|
248
|
+
client = double("client",
|
|
249
|
+
name: "testclient",
|
|
250
|
+
public_key: OpenSSL::PKey::RSA.new(1024).public_key)
|
|
251
|
+
allow(ChefVault::ChefPatch::ApiClient).to receive(:load).and_return(client)
|
|
252
|
+
|
|
253
|
+
expect(item).not_to receive(:save)
|
|
254
|
+
expect(keys).to receive(:save)
|
|
255
|
+
item.refresh
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
|
|
230
259
|
describe '#clients' do
|
|
231
260
|
include BorkedNodeWithoutPublicKey
|
|
232
261
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright:: Copyright (c) 2016 Chef Software Inc.
|
|
3
|
+
# License:: Apache License, Version 2.0
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
require "chef-vault/version"
|
|
19
|
+
|
|
20
|
+
begin
|
|
21
|
+
require "github_changelog_generator/task"
|
|
22
|
+
|
|
23
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
|
24
|
+
config.future_release = ChefVault::VERSION
|
|
25
|
+
config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature".split(",")
|
|
26
|
+
config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",")
|
|
27
|
+
config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog,Question,Discussion".split(",")
|
|
28
|
+
end
|
|
29
|
+
rescue LoadError
|
|
30
|
+
puts "github_changelog_generator is not available. gem install github_changelog_generator to generate changelogs"
|
|
31
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chef-vault
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kevin Moser
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-
|
|
12
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|
|
@@ -192,6 +192,7 @@ files:
|
|
|
192
192
|
- spec/chef-vault/user_spec.rb
|
|
193
193
|
- spec/chef-vault_spec.rb
|
|
194
194
|
- spec/spec_helper.rb
|
|
195
|
+
- tasks/github_changelog_generator.rb
|
|
195
196
|
homepage: https://github.com/chef/chef-vault
|
|
196
197
|
licenses:
|
|
197
198
|
- Apache License, v2.0
|