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 +4 -4
- data/lib/secure_data_bag/secure_data_bag_item.rb +3 -2
- data/lib/secure_data_bag/version.rb +1 -1
- data/lib/secure_data_bag.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3c20cf4c00f4fa89cba3ab2ab0de2799d737d53
|
4
|
+
data.tar.gz: 4d1c5b9dc6493e6fd06745ca98497d4b8f2da70d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/lib/secure_data_bag.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|