Method: Inspec::Runner#load_attributes

Defined in:
lib/inspec/runner.rb

#load_attributes(options) ⇒ Object

determine all attributes before the execution, fetch data from secrets backend



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/inspec/runner.rb', line 55

def load_attributes(options)
  attributes = {}
  # read endpoints for secrets eg. yml file
  secrets_targets = options['attrs']
  unless secrets_targets.nil?
    secrets_targets.each do |target|
      secrets = Inspec::SecretsBackend.resolve(target)
      # merge hash values
      attributes = attributes.merge(secrets.attributes) unless secrets.nil? || secrets.attributes.nil?
    end
  end
  options['attributes'] = attributes
end