chef-config 17.6.18 → 17.7.22
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/lib/chef-config/fips.rb +1 -1
- data/lib/chef-config/mixin/train_transport.rb +6 -4
- data/lib/chef-config/path_helper.rb +1 -1
- data/lib/chef-config/version.rb +1 -1
- data/spec/unit/fips_spec.rb +1 -1
- data/spec/unit/path_helper_spec.rb +16 -16
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5ed8b08f30c0832843cb6f65184e754df43412175f7e8e8791b832a1789d776
|
4
|
+
data.tar.gz: f03dfe4de2076250ea235da89ab661464063fa5d435788f2e02d382184381f48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 912db29f2ccbbe90ec3e9169ea20ada94ffe0a70816af4afeafba4e4c152a4344417ee0afe853cd440dd0932cc5542cfabc55a5b22dccaf87c40bd8311965647
|
7
|
+
data.tar.gz: 21ee47419e5b8e554bcfb513e967b05a2a0d380b893f80c3209a72f76c36d550edee178d500b99d14a8b59c990e82d47492a97cfcc6b484147f49cdf46ffb30e
|
data/lib/chef-config/fips.rb
CHANGED
@@ -39,7 +39,7 @@ module ChefConfig
|
|
39
39
|
Win32::Registry::KEY_READ
|
40
40
|
end
|
41
41
|
begin
|
42
|
-
Win32::Registry::HKEY_LOCAL_MACHINE.open(
|
42
|
+
Win32::Registry::HKEY_LOCAL_MACHINE.open("System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy", reg_type) do |policy|
|
43
43
|
policy["Enabled"] != 0
|
44
44
|
end
|
45
45
|
rescue Win32::Registry::Error
|
@@ -108,12 +108,14 @@ module ChefConfig
|
|
108
108
|
|
109
109
|
# Load the target_mode config context from config, and place any valid settings into the train configuration
|
110
110
|
tm_config = config.target_mode
|
111
|
-
protocol = tm_config.protocol
|
112
|
-
train_config = tm_config.to_hash.select { |k| Train.options(protocol).key?(k) }
|
113
|
-
logger.trace("Using target mode options from #{ChefUtils::Dist::Infra::PRODUCT} config file: #{train_config.keys.join(", ")}") if train_config
|
114
111
|
|
115
112
|
# Load the credentials file, and place any valid settings into the train configuration
|
116
113
|
credentials = load_credentials(tm_config.host)
|
114
|
+
|
115
|
+
protocol = credentials[:transport_protocol] || tm_config.protocol
|
116
|
+
train_config = tm_config.to_hash.select { |k| Train.options(protocol).key?(k) }
|
117
|
+
logger.trace("Using target mode options from #{ChefUtils::Dist::Infra::PRODUCT} config file: #{train_config.keys.join(", ")}") if train_config
|
118
|
+
|
117
119
|
if credentials
|
118
120
|
valid_settings = credentials.select { |k| Train.options(protocol).key?(k) }
|
119
121
|
valid_settings[:enable_password] = credentials[:enable_password] if credentials.key?(:enable_password)
|
@@ -126,7 +128,7 @@ module ChefConfig
|
|
126
128
|
# Train handles connection retries for us
|
127
129
|
Train.create(protocol, train_config)
|
128
130
|
rescue SocketError => e # likely a dns failure, not caught by train
|
129
|
-
e.message.replace "Error connecting to #{train_config[:target]} - #{e.message}"
|
131
|
+
e.message.replace "Error connecting to #{train_config[:target]} via #{protocol} - #{e.message}"
|
130
132
|
raise e
|
131
133
|
rescue Train::PluginLoadError
|
132
134
|
logger.error("Invalid target mode protocol: #{protocol}")
|
@@ -335,7 +335,7 @@ module ChefConfig
|
|
335
335
|
line.scan(/\s*(?>([^\s\\"]+|"([^"]*)"|'([^']*)')|(\S))(\s|\z)?/m) do |word, within_dq, within_sq, esc, sep|
|
336
336
|
|
337
337
|
# Append the string with Word & Escape Character
|
338
|
-
field << (word || esc.gsub(/\\(.)/,
|
338
|
+
field << (word || esc.gsub(/\\(.)/, "\\1"))
|
339
339
|
|
340
340
|
# Re-build the field when any whitespace character or
|
341
341
|
# End of string is encountered
|
data/lib/chef-config/version.rb
CHANGED
data/spec/unit/fips_spec.rb
CHANGED
@@ -65,7 +65,7 @@ RSpec.describe "ChefConfig.fips?" do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
context "on windows", :windows_only do
|
68
|
-
let(:fips_key) {
|
68
|
+
let(:fips_key) { "System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy" }
|
69
69
|
let(:win_reg_entry) { { "Enabled" => enabled } }
|
70
70
|
|
71
71
|
before(:each) do
|
@@ -62,31 +62,31 @@ RSpec.describe ChefConfig::PathHelper do
|
|
62
62
|
context "platform-specific #join behavior" do
|
63
63
|
it "joins components on Windows when some end with unix separators" do
|
64
64
|
expected = "C:\\foo\\bar\\baz"
|
65
|
-
expect(path_helper.join(
|
65
|
+
expect(path_helper.join("C:\\foo/", "bar", "baz", windows: true)).to eq(expected)
|
66
66
|
end
|
67
67
|
|
68
68
|
it "joins components when some end with separators" do
|
69
69
|
expected = "C:\\foo\\bar\\baz"
|
70
|
-
expect(path_helper.join(
|
70
|
+
expect(path_helper.join("C:\\foo\\", "bar", "baz", windows: true)).to eq(expected)
|
71
71
|
end
|
72
72
|
|
73
73
|
it "joins components when some end and start with separators" do
|
74
74
|
expected = "C:\\foo\\bar\\baz"
|
75
|
-
expect(path_helper.join(
|
75
|
+
expect(path_helper.join("C:\\foo\\", "bar/", "/baz", windows: true)).to eq(expected)
|
76
76
|
end
|
77
77
|
|
78
78
|
it "joins components that don't end in separators" do
|
79
79
|
expected = "C:\\foo\\bar\\baz"
|
80
|
-
expect(path_helper.join(
|
80
|
+
expect(path_helper.join("C:\\foo", "bar", "baz", windows: true)).to eq(expected)
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
84
|
it "cleanpath changes slashes into backslashes and leaves backslashes alone" do
|
85
|
-
expect(path_helper.cleanpath(
|
85
|
+
expect(path_helper.cleanpath("/a/b\\c/d/", windows: true)).to eq("\\a\\b\\c\\d")
|
86
86
|
end
|
87
87
|
|
88
88
|
it "cleanpath does not remove leading double backslash" do
|
89
|
-
expect(path_helper.cleanpath(
|
89
|
+
expect(path_helper.cleanpath("\\\\a/b\\c/d/", windows: true)).to eq("\\\\a\\b\\c\\d")
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
@@ -117,11 +117,11 @@ RSpec.describe ChefConfig::PathHelper do
|
|
117
117
|
end
|
118
118
|
|
119
119
|
it "cleanpath changes backslashes into slashes and leaves slashes alone" do
|
120
|
-
expect(path_helper.cleanpath(
|
120
|
+
expect(path_helper.cleanpath("/a/b\\c/d/", windows: false)).to eq("/a/b/c/d")
|
121
121
|
end
|
122
122
|
|
123
123
|
it "cleanpath does not remove leading double backslash" do
|
124
|
-
expect(path_helper.cleanpath(
|
124
|
+
expect(path_helper.cleanpath("\\\\a/b\\c/d/", windows: false)).to eq("//a/b/c/d")
|
125
125
|
end
|
126
126
|
end
|
127
127
|
end
|
@@ -139,31 +139,31 @@ RSpec.describe ChefConfig::PathHelper do
|
|
139
139
|
context "platform-specific #join behavior" do
|
140
140
|
it "joins components on Windows when some end with unix separators" do
|
141
141
|
expected = "C:\\foo\\bar\\baz"
|
142
|
-
expect(path_helper.join(
|
142
|
+
expect(path_helper.join("C:\\foo/", "bar", "baz")).to eq(expected)
|
143
143
|
end
|
144
144
|
|
145
145
|
it "joins components when some end with separators" do
|
146
146
|
expected = "C:\\foo\\bar\\baz"
|
147
|
-
expect(path_helper.join(
|
147
|
+
expect(path_helper.join("C:\\foo\\", "bar", "baz")).to eq(expected)
|
148
148
|
end
|
149
149
|
|
150
150
|
it "joins components when some end and start with separators" do
|
151
151
|
expected = "C:\\foo\\bar\\baz"
|
152
|
-
expect(path_helper.join(
|
152
|
+
expect(path_helper.join("C:\\foo\\", "bar/", "/baz")).to eq(expected)
|
153
153
|
end
|
154
154
|
|
155
155
|
it "joins components that don't end in separators" do
|
156
156
|
expected = "C:\\foo\\bar\\baz"
|
157
|
-
expect(path_helper.join(
|
157
|
+
expect(path_helper.join("C:\\foo", "bar", "baz")).to eq(expected)
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
161
|
it "cleanpath changes slashes into backslashes and leaves backslashes alone" do
|
162
|
-
expect(path_helper.cleanpath(
|
162
|
+
expect(path_helper.cleanpath("/a/b\\c/d/")).to eq("\\a\\b\\c\\d")
|
163
163
|
end
|
164
164
|
|
165
165
|
it "cleanpath does not remove leading double backslash" do
|
166
|
-
expect(path_helper.cleanpath(
|
166
|
+
expect(path_helper.cleanpath("\\\\a/b\\c/d/")).to eq("\\\\a\\b\\c\\d")
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
@@ -198,12 +198,12 @@ RSpec.describe ChefConfig::PathHelper do
|
|
198
198
|
end
|
199
199
|
|
200
200
|
it "cleanpath changes backslashes into slashes and leaves slashes alone" do
|
201
|
-
expect(path_helper.cleanpath(
|
201
|
+
expect(path_helper.cleanpath("/a/b\\c/d/", windows: false)).to eq("/a/b/c/d")
|
202
202
|
end
|
203
203
|
|
204
204
|
# NOTE: this seems a bit weird to me, but this is just the way Pathname#cleanpath works
|
205
205
|
it "cleanpath does not remove leading double backslash" do
|
206
|
-
expect(path_helper.cleanpath(
|
206
|
+
expect(path_helper.cleanpath("\\\\a/b\\c/d/")).to eq("//a/b/c/d")
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
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: 17.
|
4
|
+
version: 17.7.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-25 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: 17.
|
19
|
+
version: 17.7.22
|
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: 17.
|
26
|
+
version: 17.7.22
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-shellout
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|