class Chef::SecretFetcher::Example

Public Instance Methods

do_fetch(identifier, version) click to toggle source
# File lib/chef/secret_fetcher/example.rb, line 39
def do_fetch(identifier, version)
  raise Chef::Exceptions::Secret::FetchFailed.new("Secret #{identifier}) not found.") unless config.key?(identifier)

  config[identifier]
end
validate!() click to toggle source
# File lib/chef/secret_fetcher/example.rb, line 33
def validate!
  if config.class != Hash
    raise Chef::Exceptions::Secret::ConfigurationInvalid.new("The Example fetcher requires a hash of secrets")
  end
end