secure_data_bag 1.0.2 → 1.0.3

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: 68c90555111b2f6ef773c3aff88d05b9d7335e1c
4
- data.tar.gz: 3a041cf31f796a35a4fce93391cee4afbc70110e
3
+ metadata.gz: f3c20cf4c00f4fa89cba3ab2ab0de2799d737d53
4
+ data.tar.gz: 4d1c5b9dc6493e6fd06745ca98497d4b8f2da70d
5
5
  SHA512:
6
- metadata.gz: db18be8c4b9d5418647cd699c7efcbeeb43a0f76f2e35e012b0a92f6910d5a12a5cb79ad3fa7364672a02a86a458343759a50ec7c17f24aeca0f375e8737e037
7
- data.tar.gz: 9b818ec9bb0d19956578a3705e461979b0b8c4ff19d97ffb6675cfa6c9f882df3765a5a2ee37bd00c8ca2c1d2a91399c4b71b167cb99ee2b8a7d56bcd7b3110e
6
+ metadata.gz: 6532b5704472c8bd58aa7526fea2cd9efb8b1321024127536bd2a521b61c474c64b5f723b26a131bf21dbcdc2375b3a6c868d18bc3c32a88147268c8dcb3820a
7
+ data.tar.gz: 76f9c8b340b879e417428c3a39ef2ac5f3b8f12e8ce771ea7dc2117fbb5dd5fd194abe614a7ffb6f3fb9bf66645df4a32d7afd1e7a4dfb0934cb6db976520fc2
@@ -82,6 +82,7 @@ module SecureDataBag
82
82
  #
83
83
 
84
84
  def encoded_fields(arg=nil)
85
+ arg = arg.uniq if arg
85
86
  set_or_return(:encoded_fields, arg, kind_of: Array)
86
87
  end
87
88
 
@@ -134,10 +135,10 @@ module SecureDataBag
134
135
  item
135
136
  end
136
137
 
137
- def self.from_data_bag_item(h)
138
+ def self.from_item(h)
138
139
  item = self.from_hash(h.to_hash)
139
140
  item.data_bag = h.data_bag
140
-
141
+ item
141
142
  end
142
143
 
143
144
  def to_hash
@@ -1,5 +1,5 @@
1
1
 
2
2
  module SecureDataBag
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
 
@@ -7,3 +7,24 @@ require "secure_data_bag/secure_data_bag_item.rb"
7
7
  require "secure_data_bag/decryptor.rb"
8
8
  require "secure_data_bag/encryptor.rb"
9
9
 
10
+ class Chef
11
+ module DSL
12
+ module DataQuery
13
+ def secure_data_bag_item(bag, item)
14
+ DataBag.validate_name!(bag.to_s)
15
+ SecureDataBagItem.validate_id!(item)
16
+ SecureDataBagItem.load(bag, item)
17
+ rescue Exception
18
+ Log.error("Failed to load secure data bag item: #{bag.inspect} #{item.inspect}")
19
+ raise
20
+ end
21
+
22
+ def secure_data_bag_item!(item, fields=[])
23
+ secure = SecureDataBag::SecureDataBagItem.from_item item
24
+ secure.encode_fields secure.encode_fields + fields
25
+ secure
26
+ end
27
+ end
28
+ end
29
+ end
30
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secure_data_bag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Serafini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2014-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake