chef-encrypted-attributes 0.4.0 → 0.5.0

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: e6d1bc69146514a06cc1e531b167dcc1181d2076
4
- data.tar.gz: f0bd3f332555ff57c8fc1340d855df6ef8c98615
3
+ metadata.gz: 810a37dff2980969d642d2759f2ee1c09fdb1ebf
4
+ data.tar.gz: 3e199cd293403bdeccb89a1e6ce0ca93913f5bf2
5
5
  SHA512:
6
- metadata.gz: 3e62b8c12e4dcb98b2fee808e01a8ca27e390cd434e3c4bcb9c53720ed0965ec2ecb6fcb4e9f476c03e645046d1a209912e6941663daa459eaff7534e0271124
7
- data.tar.gz: aa3e2077dd7c68289ff0e7c79ffbfc928c5ae3e3dcd94bba77471ec478e7f6ec0bfe29de80f6cf4b5aeeb320ed88ddd8869f95cf2fc701d4830c64d41fb9e6ef
6
+ metadata.gz: 62020afcc9d396f9800c8364f5e3f111dc19ac6e7fa8639c2f0737dc071e257a4355a7ceef0d5c35bbeb7807fd857573982ab76d52db5ad01a1c79265db490cd
7
+ data.tar.gz: 1102b54b595fe434c360adea4367eea8ce44061c52cbea4262b87c1b6dd5e1783e859b07701ee68643a8f686fcbeb9d2a7aa1a4482fa85636c17cd125ba422d1
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  This file is used to list changes made in each version of `chef-encrypted-attributes`.
4
4
 
5
+ ## 0.5.0 (2015-04-03)
6
+
7
+ * `#load_from_node` raises an exception if no ecnrypted attribute is found.
8
+ * GemSpec:
9
+ * Fix Ruby < 2 support ([issue #2](https://github.com/onddo/chef-encrypted-attributes/pull/2), thanks [@chhsiung](https://github.com/chhsiung) for the help).
10
+ * Depend on `ffi-yajl` `< 3` as in Chef.
11
+
12
+ * Tests:
13
+ * Use the new build environment on Travis ([issue #1](https://github.com/onddo/chef-encrypted-attributes/pull/1), thanks [Josh Kalderimis](https://github.com/joshk))
14
+ * GemSpec: Update RuboCop to version `0.29.1` (new offenses fixed).
15
+
16
+ * Documentation:
17
+ * README: Fix testing link.
18
+
5
19
  ## 0.4.0 (2014-12-10)
6
20
 
7
21
  * Add Chef `12` support.
data/LICENSE CHANGED
@@ -175,7 +175,7 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
175
175
 
176
176
  END OF TERMS AND CONDITIONS
177
177
 
178
- Copyright 2014 Onddo Labs, SL. (www.onddo.com)
178
+ Copyright 2014-2015 Onddo Labs, SL. (www.onddo.com)
179
179
 
180
180
  Licensed under the Apache License, Version 2.0 (the "License");
181
181
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
  [![Gem Version](http://img.shields.io/gem/v/chef-encrypted-attributes.svg?style=flat)](http://badge.fury.io/rb/chef-encrypted-attributes)
3
3
  [![Dependency Status](http://img.shields.io/gemnasium/onddo/chef-encrypted-attributes.svg?style=flat)](https://gemnasium.com/onddo/chef-encrypted-attributes)
4
4
  [![Code Climate](http://img.shields.io/codeclimate/github/onddo/chef-encrypted-attributes.svg?style=flat)](https://codeclimate.com/github/onddo/chef-encrypted-attributes)
5
- [![Build Status](http://img.shields.io/travis/onddo/chef-encrypted-attributes/0.4.0.svg?style=flat)](https://travis-ci.org/onddo/chef-encrypted-attributes)
6
- [![Coverage Status](http://img.shields.io/coveralls/onddo/chef-encrypted-attributes/0.4.0.svg?style=flat)](https://coveralls.io/r/onddo/chef-encrypted-attributes?branch=0.4.0)
7
- [![Inline docs](http://inch-ci.org/github/onddo/chef-encrypted-attributes.svg?branch=0.4.0&style=flat)](http://inch-ci.org/github/onddo/chef-encrypted-attributes)
5
+ [![Build Status](http://img.shields.io/travis/onddo/chef-encrypted-attributes.svg?style=flat)](https://travis-ci.org/onddo/chef-encrypted-attributes)
6
+ [![Coverage Status](http://img.shields.io/coveralls/onddo/chef-encrypted-attributes.svg?style=flat)](https://coveralls.io/r/onddo/chef-encrypted-attributes?branch=master)
7
+ [![Inline docs](http://inch-ci.org/github/onddo/chef-encrypted-attributes.svg?branch=master&style=flat)](http://inch-ci.org/github/onddo/chef-encrypted-attributes)
8
8
 
9
9
  [Chef](https://www.chef.io/) plugin to add Node encrypted attributes support using client keys.
10
10
 
@@ -193,11 +193,11 @@ See the [official gem documentation](http://www.rubydoc.info/gems/chef-encrypted
193
193
 
194
194
  The `chef-encrypted-attributes` gem is cryptographically signed by Onddo Labs's certificate, which identifies as *team@onddo.com*. You can obtain the official signature here:
195
195
 
196
- https://raw.github.com/onddo/chef-encrypted-attributes/0.4.0/certs/team_onddo.crt
196
+ https://raw.github.com/onddo/chef-encrypted-attributes/master/certs/team_onddo.crt
197
197
 
198
198
  To be sure the gem you install has not been tampered with:
199
199
 
200
- $ gem cert --add <(curl -Ls https://raw.github.com/onddo/chef-encrypted-attributes/0.4.0/certs/team_onddo.crt)
200
+ $ gem cert --add <(curl -Ls https://raw.github.com/onddo/chef-encrypted-attributes/master/certs/team_onddo.crt)
201
201
  $ gem install chef-encrypted-attributes -P MediumSecurity
202
202
 
203
203
  The *MediumSecurity* trust profile will verify signed gems, but allow the installation of unsigned dependencies. This is necessary because not all of `chef-encrypted-attributes`'s dependencies are signed, so we cannot use *HighSecurity*.
@@ -216,7 +216,7 @@ Still, this gem should be considered experimental until audited by professional
216
216
 
217
217
  If you have discovered a bug in `chef-encrypted-attributes` of a sensitive nature, i.e. one which can compromise the security of `chef-encrypted-attributes` users, you can report it securely by sending a GPG encrypted message. Please use the following key:
218
218
 
219
- https://raw.github.com/onddo/chef-encrypted-attributes/0.4.0/zuazo.gpg
219
+ https://raw.github.com/onddo/chef-encrypted-attributes/master/zuazo.gpg
220
220
 
221
221
  The key fingerprint is (or should be):
222
222
 
@@ -224,7 +224,7 @@ The key fingerprint is (or should be):
224
224
 
225
225
  ## Testing
226
226
 
227
- See [TESTING.md]((https://github.com/onddo/chef-encrypted-attributes/blob/master/TESTING.md).
227
+ See [TESTING.md](https://github.com/onddo/chef-encrypted-attributes/blob/master/TESTING.md).
228
228
 
229
229
  ## Contributing
230
230
 
@@ -241,7 +241,9 @@ See [TODO.md](https://github.com/onddo/chef-encrypted-attributes/blob/master/TOD
241
241
  | | |
242
242
  |:---------------------|:-----------------------------------------|
243
243
  | **Author:** | [Xabier de Zuazo](https://github.com/zuazo) (<xabier@onddo.com>)
244
- | **Copyright:** | Copyright (c) 2014 Onddo Labs, SL. (www.onddo.com)
244
+ | **Contributor:** | [Josh Kalderimis](https://github.com/joshk)
245
+ | **Contributor:** | [@chhsiung](https://github.com/chhsiung)
246
+ | **Copyright:** | Copyright (c) 2014-2015 Onddo Labs, SL. (www.onddo.com)
245
247
  | **License:** | Apache License, Version 2.0
246
248
 
247
249
  Licensed under the Apache License, Version 2.0 (the "License");
@@ -75,12 +75,9 @@ class Chef
75
75
  # @param key [String, Symbol] cache key to read.
76
76
  # @return [Mixed] cache key value.
77
77
  def [](key)
78
- if key?(key)
79
- val = super(key)
80
- self[key] = val
81
- else
82
- nil
83
- end
78
+ return nil unless key?(key)
79
+ val = super(key)
80
+ self[key] = val
84
81
  end
85
82
 
86
83
  # Sets a cache key.
@@ -254,8 +254,6 @@ class Chef
254
254
  rescue OpenSSL::PKey::RSAError, TypeError
255
255
  nil
256
256
  end
257
- else
258
- nil
259
257
  end
260
258
  return false if rsa_k.nil?
261
259
  rsa_k.public?
@@ -160,6 +160,10 @@ class Chef
160
160
  # @raise [UnsupportedEncryptedAttributeFormat] if encrypted attribute
161
161
  # format is not supported or unknown.
162
162
  def self.json_create(enc_hs)
163
+ unless enc_hs.is_a?(Hash)
164
+ fail UnacceptableEncryptedAttributeFormat,
165
+ 'Encrypted attribute not found or corrupted.'
166
+ end
163
167
  klass = string_to_klass(enc_hs[JSON_CLASS])
164
168
  if klass.nil?
165
169
  fail UnsupportedEncryptedAttributeFormat,
@@ -66,7 +66,7 @@ class Chef
66
66
  #
67
67
  # @param attr_ary [Array<String>] node attribute path as Array.
68
68
  # @param partial_search [Boolean] whether to use partial search.
69
- # @return [Mixed] node attribute value.
69
+ # @return [Mixed] node attribute value, `nil` if not found.
70
70
  # @raise [ArgumentError] if the attribute path format is wrong.
71
71
  # @raise [SearchFailure] if there is a Chef search error.
72
72
  # @raise [SearchFatalError] if the Chef search response is wrong.
@@ -134,11 +134,10 @@ class Chef
134
134
  # @param res [Array<Hash>] {SearchHelper#search} result.
135
135
  # @return [Mixed] final search result value.
136
136
  def parse_search_result(res)
137
- if res.is_a?(Array) && res[0].is_a?(Hash) && res[0].key?('value')
138
- res[0]['value']
139
- else
140
- nil
137
+ unless res.is_a?(Array) && res[0].is_a?(Hash) && res[0].key?('value')
138
+ return nil
141
139
  end
140
+ res[0]['value']
142
141
  end
143
142
 
144
143
  # Generates the cache key.
@@ -20,6 +20,6 @@
20
20
  class Chef
21
21
  class EncryptedAttribute
22
22
  # `chef-encrypted-attributes` gem version.
23
- VERSION = '0.4.0'
23
+ VERSION = '0.5.0'
24
24
  end
25
25
  end
@@ -30,7 +30,6 @@ class Chef
30
30
  # @param includer [Class] includer class.
31
31
  def self.included(includer)
32
32
  includer.class_eval do
33
-
34
33
  # Helper method to set the encrypted attributes configuration.
35
34
  def self.encrypted_attributes_option_set(key, value)
36
35
  Chef::Config[:knife][:encrypted_attributes][key] = value
@@ -66,9 +66,8 @@ class Chef
66
66
  parse_args
67
67
 
68
68
  # update encrypted attribute
69
- enc_attr = Chef::EncryptedAttribute.new(
70
- Chef::Config[:knife][:encrypted_attributes]
71
- )
69
+ knife_config = Chef::Config[:knife][:encrypted_attributes]
70
+ enc_attr = Chef::EncryptedAttribute.new(knife_config)
72
71
  if enc_attr.update_on_node(@node_name, @attr_ary)
73
72
  ui.info('Encrypted attribute updated.')
74
73
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-encrypted-attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onddo Labs, SL.
@@ -30,22 +30,28 @@ cert_chain:
30
30
  cYe8PqNEkky7ugvF4zU3sB6TW+96XasuwDv1uJmyr35LF15U6Cs83+osMbAKJTmG
31
31
  /vqKzw==
32
32
  -----END CERTIFICATE-----
33
- date: 2014-12-10 00:00:00.000000000 Z
33
+ date: 2015-04-03 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: ffi-yajl
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.0'
42
+ - - "<"
43
+ - !ruby/object:Gem::Version
44
+ version: '3.0'
42
45
  type: :runtime
43
46
  prerelease: false
44
47
  version_requirements: !ruby/object:Gem::Requirement
45
48
  requirements:
46
- - - "~>"
49
+ - - ">="
47
50
  - !ruby/object:Gem::Version
48
51
  version: '1.0'
52
+ - - "<"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
49
55
  - !ruby/object:Gem::Dependency
50
56
  name: chef
51
57
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +190,14 @@ dependencies:
184
190
  requirements:
185
191
  - - '='
186
192
  - !ruby/object:Gem::Version
187
- version: 0.27.1
193
+ version: 0.29.1
188
194
  type: :development
189
195
  prerelease: false
190
196
  version_requirements: !ruby/object:Gem::Requirement
191
197
  requirements:
192
198
  - - '='
193
199
  - !ruby/object:Gem::Version
194
- version: 0.27.1
200
+ version: 0.29.1
195
201
  description: Chef plugin to add Node encrypted attributes support using client keys
196
202
  email: team@onddo.com
197
203
  executables: []
metadata.gz.sig CHANGED
Binary file