Method: Chef::EncryptedDataBagItem.load

Defined in:
lib/chef/encrypted_data_bag_item.rb

.load(data_bag, name, secret = nil) ⇒ Object

=== Synopsis

EncryptedDataBagItem.load(data_bag, name, secret = nil)

=== Args

+data_bag+:: The name of the data bag to fetch +name+:: The name of the data bag item to fetch +secret+:: The raw secret key. If the +secret+ is nil, the value of the file at +Chef::Config[:encrypted_data_bag_secret]+ is loaded. See +load_secret+ for more information.

=== Description

Loads and decrypts the data bag item with the given name.



123
124
125
126
127
# File 'lib/chef/encrypted_data_bag_item.rb', line 123

def self.load(data_bag, name, secret = nil)
  raw_hash = Chef::DataBagItem.load(data_bag, name)
  secret ||= load_secret
  new(raw_hash, secret)
end