Method: Compliance::API.get_headers
- Defined in:
- lib/bundles/inspec-compliance/api.rb
.get_headers(config) ⇒ Object
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/bundles/inspec-compliance/api.rb', line 174 def self.get_headers(config) token = get_token(config) if is_automate_server?(config) headers = { 'chef-delivery-enterprise' => config['automate']['ent'] } if config['automate']['token_type'] == 'dctoken' headers['x-data-collector-token'] = token else headers['chef-delivery-user'] = config['user'] headers['chef-delivery-token'] = token end else headers = { 'Authorization' => "Bearer #{token}" } end headers end |