chef-config 16.5.64 → 16.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/chef-config.gemspec +11 -7
- data/lib/chef-config/config.rb +8 -6
- data/lib/chef-config/mixin/dot_d.rb +1 -0
- data/lib/chef-config/mixin/fuzzy_hostname_matcher.rb +9 -1
- data/lib/chef-config/mixin/train_transport.rb +1 -1
- data/lib/chef-config/version.rb +1 -1
- data/lib/chef-config/workstation_config_loader.rb +4 -4
- data/spec/unit/config_spec.rb +2 -2
- data/spec/unit/fips_spec.rb +1 -1
- data/spec/unit/workstation_config_loader_spec.rb +1 -1
- metadata +13 -64
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf7f580b78c3f5bd73acbd33fcdad8ac1759e9823bf081eb469e1af134a77885
|
|
4
|
+
data.tar.gz: 27c073a9cf24004bda689a60b4c46d06f930fc2eb528e29acb0a1999323e759c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23bae699274292d926765683a8931fe9f9c80393a871668ea3e81ad80ff84754491f66e3e42d7d6a3bddd999602440809d317661a081d0e3136579ec1f098034
|
|
7
|
+
data.tar.gz: 3c91e2a4556f1dcee49df2781164670a87e1913608341adbb641d7ec5b8d38933b99f3f168731f915518e19c4632c81045d579fb94238c72186de37902235293
|
data/chef-config.gemspec
CHANGED
|
@@ -8,10 +8,20 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = ["Adam Jacob"]
|
|
9
9
|
spec.email = ["adam@chef.io"]
|
|
10
10
|
|
|
11
|
-
spec.summary = %q{Chef's default configuration and config loading}
|
|
11
|
+
spec.summary = %q{Chef Infra's default configuration and config loading library}
|
|
12
12
|
spec.homepage = "https://github.com/chef/chef"
|
|
13
13
|
spec.license = "Apache-2.0"
|
|
14
14
|
|
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
|
16
|
+
|
|
17
|
+
spec.metadata = {
|
|
18
|
+
"bug_tracker_uri" => "https://github.com/chef/chef/issues",
|
|
19
|
+
"changelog_uri" => "https://github.com/chef/chef/blob/master/CHANGELOG.md",
|
|
20
|
+
"documentation_uri" => "https://github.com/chef/chef/tree/master/chef-config/README.md",
|
|
21
|
+
"homepage_uri" => "https://github.com/chef/chef/tree/master/chef-config",
|
|
22
|
+
"source_code_uri" => "https://github.com/chef/chef/tree/master/chef-config",
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
spec.require_paths = ["lib"]
|
|
16
26
|
|
|
17
27
|
spec.add_dependency "chef-utils", "= #{ChefConfig::VERSION}"
|
|
@@ -21,12 +31,6 @@ Gem::Specification.new do |spec|
|
|
|
21
31
|
spec.add_dependency "addressable"
|
|
22
32
|
spec.add_dependency "tomlrb", "~> 1.2"
|
|
23
33
|
|
|
24
|
-
spec.add_development_dependency "rake"
|
|
25
|
-
|
|
26
|
-
%w{rspec-core rspec-expectations rspec-mocks}.each do |rspec|
|
|
27
|
-
spec.add_development_dependency(rspec, "~> 3.2")
|
|
28
|
-
end
|
|
29
|
-
|
|
30
34
|
spec.files = %w{Rakefile LICENSE} + Dir.glob("*.gemspec") +
|
|
31
35
|
Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
|
|
32
36
|
|
data/lib/chef-config/config.rb
CHANGED
|
@@ -33,7 +33,9 @@ module Mixlib
|
|
|
33
33
|
autoload :ShellOut, "mixlib/shellout"
|
|
34
34
|
end
|
|
35
35
|
autoload :URI, "uri"
|
|
36
|
-
|
|
36
|
+
module Addressable
|
|
37
|
+
autoload :URI, "addressable/uri"
|
|
38
|
+
end
|
|
37
39
|
autoload :OpenSSL, "openssl"
|
|
38
40
|
autoload :YAML, "yaml"
|
|
39
41
|
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
@@ -647,7 +649,7 @@ module ChefConfig
|
|
|
647
649
|
# credentials toml files which doesn't allow ruby symbol values
|
|
648
650
|
configurable(:ssl_verify_mode).writes_value do |value|
|
|
649
651
|
if value.is_a?(String) && value[0] == ":"
|
|
650
|
-
value[1
|
|
652
|
+
value[1..].to_sym
|
|
651
653
|
else
|
|
652
654
|
value.to_sym
|
|
653
655
|
end
|
|
@@ -1205,7 +1207,7 @@ module ChefConfig
|
|
|
1205
1207
|
# Transform into the form en_ZZ.UTF-8
|
|
1206
1208
|
guessed_locale.gsub(/UTF-?8$/i, "UTF-8")
|
|
1207
1209
|
else
|
|
1208
|
-
ChefConfig.logger.warn "Please install an English UTF-8 locale for
|
|
1210
|
+
ChefConfig.logger.warn "Please install an English UTF-8 locale for #{ChefUtils::Dist::Infra::PRODUCT} to use, falling back to C locale and disabling UTF-8 support."
|
|
1209
1211
|
"C"
|
|
1210
1212
|
end
|
|
1211
1213
|
end
|
|
@@ -1258,9 +1260,9 @@ module ChefConfig
|
|
|
1258
1260
|
# @api private
|
|
1259
1261
|
def self.enable_fips_mode
|
|
1260
1262
|
OpenSSL.fips_mode = true
|
|
1261
|
-
require "digest"
|
|
1262
|
-
require "digest/sha1"
|
|
1263
|
-
require "digest/md5"
|
|
1263
|
+
require "digest" unless defined?(Digest)
|
|
1264
|
+
require "digest/sha1" unless defined?(Digest::SHA1)
|
|
1265
|
+
require "digest/md5" unless defined?(Digest::MD5)
|
|
1264
1266
|
# Remove pre-existing constants if they do exist to reduce the
|
|
1265
1267
|
# amount of log spam and warnings.
|
|
1266
1268
|
Digest.send(:remove_const, "SHA1") if Digest.const_defined?("SHA1")
|
|
@@ -20,6 +20,7 @@ module ChefConfig
|
|
|
20
20
|
module Mixin
|
|
21
21
|
module DotD
|
|
22
22
|
# Find available configuration files in a `.d/` style include directory.
|
|
23
|
+
# Make sure we exclude anything that's not a file so we avoid directories ending in .rb (just in case)
|
|
23
24
|
#
|
|
24
25
|
# @api internal
|
|
25
26
|
# @param path [String] Base .d/ path to load from.
|
|
@@ -20,8 +20,16 @@ module ChefConfig
|
|
|
20
20
|
module Mixin
|
|
21
21
|
module FuzzyHostnameMatcher
|
|
22
22
|
|
|
23
|
+
#
|
|
24
|
+
# Check to see if a hostname matches a match string. Used to see if hosts fall under our no_proxy config
|
|
25
|
+
#
|
|
26
|
+
# @param [String] hostname the hostname to check
|
|
27
|
+
# @param [String] matches the pattern to match
|
|
28
|
+
#
|
|
29
|
+
# @return [Boolean]
|
|
30
|
+
#
|
|
23
31
|
def fuzzy_hostname_match_any?(hostname, matches)
|
|
24
|
-
if
|
|
32
|
+
if hostname && matches
|
|
25
33
|
return matches.to_s.split(/\s*,\s*/).compact.any? do |m|
|
|
26
34
|
fuzzy_hostname_match?(hostname, m)
|
|
27
35
|
end
|
|
@@ -44,7 +44,7 @@ module ChefConfig
|
|
|
44
44
|
|
|
45
45
|
# host names must be specified in credentials file as ['foo.example.org'] with quotes
|
|
46
46
|
if !credentials.nil? && !credentials[profile].nil?
|
|
47
|
-
credentials[profile].
|
|
47
|
+
credentials[profile].transform_keys(&:to_sym) # return symbolized keys to match Train.options()
|
|
48
48
|
else
|
|
49
49
|
nil
|
|
50
50
|
end
|
data/lib/chef-config/version.rb
CHANGED
|
@@ -166,7 +166,7 @@ module ChefConfig
|
|
|
166
166
|
when "client_key"
|
|
167
167
|
extract_key(value, :client_key, :client_key_contents)
|
|
168
168
|
when "knife"
|
|
169
|
-
Config.knife.merge!(
|
|
169
|
+
Config.knife.merge!(value.transform_keys(&:to_sym))
|
|
170
170
|
else
|
|
171
171
|
Config[key.to_sym] = value
|
|
172
172
|
end
|
|
@@ -195,8 +195,8 @@ module ChefConfig
|
|
|
195
195
|
message = ""
|
|
196
196
|
message << "You have invalid ruby syntax in your config file #{config_file_path}\n\n"
|
|
197
197
|
message << "#{e.class.name}: #{e.message}\n"
|
|
198
|
-
if file_line = e.message[/#{Regexp.escape(config_file_path)}
|
|
199
|
-
line = file_line[/:(
|
|
198
|
+
if file_line = e.message[/#{Regexp.escape(config_file_path)}:\d+/]
|
|
199
|
+
line = file_line[/:(\d+)$/, 1].to_i
|
|
200
200
|
message << highlight_config_error(config_file_path, line)
|
|
201
201
|
end
|
|
202
202
|
raise ChefConfig::ConfigurationError, message
|
|
@@ -206,7 +206,7 @@ module ChefConfig
|
|
|
206
206
|
filtered_trace = e.backtrace.grep(/#{Regexp.escape(config_file_path)}/)
|
|
207
207
|
filtered_trace.each { |bt_line| message << " " << bt_line << "\n" }
|
|
208
208
|
unless filtered_trace.empty?
|
|
209
|
-
line_nr = filtered_trace.first[/#{Regexp.escape(config_file_path)}:(
|
|
209
|
+
line_nr = filtered_trace.first[/#{Regexp.escape(config_file_path)}:(\d+)/, 1]
|
|
210
210
|
message << highlight_config_error(config_file_path, line_nr.to_i)
|
|
211
211
|
end
|
|
212
212
|
raise ChefConfig::ConfigurationError, message
|
data/spec/unit/config_spec.rb
CHANGED
|
@@ -931,7 +931,7 @@ RSpec.describe ChefConfig::Config do
|
|
|
931
931
|
|
|
932
932
|
shared_examples_for "a suitable locale" do
|
|
933
933
|
it "returns an English UTF-8 locale" do
|
|
934
|
-
expect(ChefConfig.logger).to_not receive(:warn).with(/Please install an English UTF-8 locale for Chef to use/)
|
|
934
|
+
expect(ChefConfig.logger).to_not receive(:warn).with(/Please install an English UTF-8 locale for Chef Infra Client to use/)
|
|
935
935
|
expect(ChefConfig.logger).to_not receive(:trace).with(/Defaulting to locale en_US.UTF-8 on Windows/)
|
|
936
936
|
expect(ChefConfig.logger).to_not receive(:trace).with(/No usable locale -a command found/)
|
|
937
937
|
expect(ChefConfig::Config.guess_internal_locale).to eq expected_locale
|
|
@@ -984,7 +984,7 @@ RSpec.describe ChefConfig::Config do
|
|
|
984
984
|
let(:locale_array) { ["af_ZA", "af_ZA.ISO8859-1", "af_ZA.ISO8859-15", "af_ZA.UTF-8"] }
|
|
985
985
|
|
|
986
986
|
it "should fall back to C locale" do
|
|
987
|
-
expect(ChefConfig.logger).to receive(:warn).with("Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.")
|
|
987
|
+
expect(ChefConfig.logger).to receive(:warn).with("Please install an English UTF-8 locale for Chef Infra Client to use, falling back to C locale and disabling UTF-8 support.")
|
|
988
988
|
expect(ChefConfig::Config.guess_internal_locale).to eq "C"
|
|
989
989
|
end
|
|
990
990
|
end
|
data/spec/unit/fips_spec.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chef-config
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 16.
|
|
4
|
+
version: 16.8.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Jacob
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: chef-utils
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 16.
|
|
19
|
+
version: 16.8.14
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - '='
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 16.
|
|
26
|
+
version: 16.8.14
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: mixlib-shellout
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -106,62 +106,6 @@ dependencies:
|
|
|
106
106
|
- - "~>"
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
108
|
version: '1.2'
|
|
109
|
-
- !ruby/object:Gem::Dependency
|
|
110
|
-
name: rake
|
|
111
|
-
requirement: !ruby/object:Gem::Requirement
|
|
112
|
-
requirements:
|
|
113
|
-
- - ">="
|
|
114
|
-
- !ruby/object:Gem::Version
|
|
115
|
-
version: '0'
|
|
116
|
-
type: :development
|
|
117
|
-
prerelease: false
|
|
118
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
119
|
-
requirements:
|
|
120
|
-
- - ">="
|
|
121
|
-
- !ruby/object:Gem::Version
|
|
122
|
-
version: '0'
|
|
123
|
-
- !ruby/object:Gem::Dependency
|
|
124
|
-
name: rspec-core
|
|
125
|
-
requirement: !ruby/object:Gem::Requirement
|
|
126
|
-
requirements:
|
|
127
|
-
- - "~>"
|
|
128
|
-
- !ruby/object:Gem::Version
|
|
129
|
-
version: '3.2'
|
|
130
|
-
type: :development
|
|
131
|
-
prerelease: false
|
|
132
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
133
|
-
requirements:
|
|
134
|
-
- - "~>"
|
|
135
|
-
- !ruby/object:Gem::Version
|
|
136
|
-
version: '3.2'
|
|
137
|
-
- !ruby/object:Gem::Dependency
|
|
138
|
-
name: rspec-expectations
|
|
139
|
-
requirement: !ruby/object:Gem::Requirement
|
|
140
|
-
requirements:
|
|
141
|
-
- - "~>"
|
|
142
|
-
- !ruby/object:Gem::Version
|
|
143
|
-
version: '3.2'
|
|
144
|
-
type: :development
|
|
145
|
-
prerelease: false
|
|
146
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
147
|
-
requirements:
|
|
148
|
-
- - "~>"
|
|
149
|
-
- !ruby/object:Gem::Version
|
|
150
|
-
version: '3.2'
|
|
151
|
-
- !ruby/object:Gem::Dependency
|
|
152
|
-
name: rspec-mocks
|
|
153
|
-
requirement: !ruby/object:Gem::Requirement
|
|
154
|
-
requirements:
|
|
155
|
-
- - "~>"
|
|
156
|
-
- !ruby/object:Gem::Version
|
|
157
|
-
version: '3.2'
|
|
158
|
-
type: :development
|
|
159
|
-
prerelease: false
|
|
160
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
161
|
-
requirements:
|
|
162
|
-
- - "~>"
|
|
163
|
-
- !ruby/object:Gem::Version
|
|
164
|
-
version: '3.2'
|
|
165
109
|
description:
|
|
166
110
|
email:
|
|
167
111
|
- adam@chef.io
|
|
@@ -193,7 +137,12 @@ files:
|
|
|
193
137
|
homepage: https://github.com/chef/chef
|
|
194
138
|
licenses:
|
|
195
139
|
- Apache-2.0
|
|
196
|
-
metadata:
|
|
140
|
+
metadata:
|
|
141
|
+
bug_tracker_uri: https://github.com/chef/chef/issues
|
|
142
|
+
changelog_uri: https://github.com/chef/chef/blob/master/CHANGELOG.md
|
|
143
|
+
documentation_uri: https://github.com/chef/chef/tree/master/chef-config/README.md
|
|
144
|
+
homepage_uri: https://github.com/chef/chef/tree/master/chef-config
|
|
145
|
+
source_code_uri: https://github.com/chef/chef/tree/master/chef-config
|
|
197
146
|
post_install_message:
|
|
198
147
|
rdoc_options: []
|
|
199
148
|
require_paths:
|
|
@@ -202,15 +151,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
202
151
|
requirements:
|
|
203
152
|
- - ">="
|
|
204
153
|
- !ruby/object:Gem::Version
|
|
205
|
-
version:
|
|
154
|
+
version: 2.6.0
|
|
206
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
156
|
requirements:
|
|
208
157
|
- - ">="
|
|
209
158
|
- !ruby/object:Gem::Version
|
|
210
159
|
version: '0'
|
|
211
160
|
requirements: []
|
|
212
|
-
rubygems_version: 3.1.
|
|
161
|
+
rubygems_version: 3.1.4
|
|
213
162
|
signing_key:
|
|
214
163
|
specification_version: 4
|
|
215
|
-
summary: Chef's default configuration and config loading
|
|
164
|
+
summary: Chef Infra's default configuration and config loading library
|
|
216
165
|
test_files: []
|