Method: Compliance::API.get_headers
- Defined in:
- lib/bundles/inspec-compliance/api.rb
.get_headers(config) ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/bundles/inspec-compliance/api.rb', line 163 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 |