inspec 1.28.1 → 1.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/fetchers/url.rb +37 -15
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/command.rb +3 -0
- data/lib/resources/postgres.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a517bb883e12e171576ca6d64da4005fc89eb117
|
4
|
+
data.tar.gz: '04879fa4af63f6e2274b2965d1167bc5971c9b59'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f97bd24162ff420b55122fdfe53abecdb06085d2fce6dddbea87eb47f140e30785e1d607ddd081dcf45a0ed3ff11112a9a48eca02ed2c22d2b6023492cc9294a
|
7
|
+
data.tar.gz: 20b0a7c4dc401b382d99c9bbb6c691bf4ffbbe147dda7c1d2e24076a851ed746b3bbf89539b12a1329cec87f8fe04c2e8f699fb736d31478b2bf53d92f736b4f
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,21 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v1.29.0](https://github.com/chef/inspec/tree/v1.29.0) (2017-06-22)
|
4
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v1.28.1...v1.29.0)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- Don't send HTTP headers that have nil values [\#1948](https://github.com/chef/inspec/pull/1948) ([adamleff](https://github.com/adamleff))
|
9
|
+
- small typo in the postgres resource with exist? function and assignment of data\_dir\_loc. [\#1937](https://github.com/chef/inspec/pull/1937) ([aaronlippold](https://github.com/aaronlippold))
|
10
|
+
- reject `nil` as a command input [\#1863](https://github.com/chef/inspec/pull/1863) ([arlimus](https://github.com/arlimus))
|
11
|
+
|
3
12
|
## [v1.28.1](https://github.com/chef/inspec/tree/v1.28.1) (2017-06-16)
|
4
13
|
[Full Changelog](https://github.com/chef/inspec/compare/v1.28.0...v1.28.1)
|
5
14
|
|
15
|
+
**Implemented enhancements:**
|
16
|
+
|
17
|
+
- Adding toml resource [\#1924](https://github.com/chef/inspec/pull/1924) ([nsdavidson](https://github.com/nsdavidson))
|
18
|
+
|
6
19
|
**Fixed bugs:**
|
7
20
|
|
8
21
|
- Update zlib to 1.2.11 to address known CVEs [\#1934](https://github.com/chef/inspec/issues/1934)
|
data/lib/fetchers/url.rb
CHANGED
@@ -143,21 +143,6 @@ module Fetchers
|
|
143
143
|
def download_archive_to_temp
|
144
144
|
return @temp_archive_path if ! @temp_archive_path.nil?
|
145
145
|
Inspec::Log.debug("Fetching URL: #{@target}")
|
146
|
-
http_opts = {}
|
147
|
-
http_opts['ssl_verify_mode'.to_sym] = OpenSSL::SSL::VERIFY_NONE if @insecure
|
148
|
-
if @config
|
149
|
-
if @config['server_type'] == 'automate'
|
150
|
-
http_opts['chef-delivery-enterprise'] = @config['automate']['ent']
|
151
|
-
if @config['automate']['token_type'] == 'dctoken'
|
152
|
-
http_opts['x-data-collector-token'] = @config['token']
|
153
|
-
else
|
154
|
-
http_opts['chef-delivery-user'] = @config['user']
|
155
|
-
http_opts['chef-delivery-token'] = @config['token']
|
156
|
-
end
|
157
|
-
elsif @token
|
158
|
-
http_opts['Authorization'] = "Bearer #{@token}"
|
159
|
-
end
|
160
|
-
end
|
161
146
|
remote = open(@target, http_opts)
|
162
147
|
@archive_type = file_type_from_remote(remote) # side effect :(
|
163
148
|
archive = Tempfile.new(['inspec-dl-', @archive_type])
|
@@ -178,5 +163,42 @@ module Fetchers
|
|
178
163
|
@temp_archive_path = nil
|
179
164
|
final_path
|
180
165
|
end
|
166
|
+
|
167
|
+
def http_opts
|
168
|
+
opts = {}
|
169
|
+
opts[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE if @insecure
|
170
|
+
|
171
|
+
if @config['server_type'] == 'automate'
|
172
|
+
opts['chef-delivery-enterprise'] = @config['automate']['ent']
|
173
|
+
if @config['automate']['token_type'] == 'dctoken'
|
174
|
+
opts['x-data-collector-token'] = @config['token']
|
175
|
+
else
|
176
|
+
opts['chef-delivery-user'] = @config['user']
|
177
|
+
opts['chef-delivery-token'] = @config['token']
|
178
|
+
end
|
179
|
+
elsif @token
|
180
|
+
opts['Authorization'] = "Bearer #{@token}"
|
181
|
+
end
|
182
|
+
|
183
|
+
# Do not send any headers that have nil values.
|
184
|
+
# Net::HTTP does not gracefully handle this situation.
|
185
|
+
check_for_missing_values!(opts)
|
186
|
+
|
187
|
+
opts
|
188
|
+
end
|
189
|
+
|
190
|
+
def check_for_missing_values!(opts)
|
191
|
+
keys_missing_values = opts.keys.delete_if do |k|
|
192
|
+
if opts[k].nil?
|
193
|
+
false
|
194
|
+
elsif opts[k].respond_to?(:empty?) && opts[k].empty?
|
195
|
+
false
|
196
|
+
else
|
197
|
+
true
|
198
|
+
end
|
199
|
+
end
|
200
|
+
raise 'Unable to fetch profile - the following HTTP headers have no value: ' \
|
201
|
+
"#{keys_missing_values.join(', ')}" unless keys_missing_values.empty?
|
202
|
+
end
|
181
203
|
end
|
182
204
|
end
|
data/lib/inspec/version.rb
CHANGED
data/lib/resources/command.rb
CHANGED
data/lib/resources/postgres.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train
|