chef-config 19.1.164 → 19.2.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 309b22099435d14e4f8be71a98aff1005772ac64dbf60c440e5d33f4fce10d53
4
- data.tar.gz: 8c46f82f7c17fdb2330ca0f2182f9e9476b3d7f96c18b13728d8749d1b86831a
3
+ metadata.gz: ea55ab8eb7a297d9cb3c659129bf6dec381a9ea0f04642aca950589b8519bcf7
4
+ data.tar.gz: 6bf7b00213a4ff9f8a0f4b7f249cff6c9963ab5c17fe4cbf0759aa599acba499
5
5
  SHA512:
6
- metadata.gz: c822ebbe0118452e6240c8d1c0818f90a13701694fa3d93fd700d123ce8150130ab911d076409c76989928678c0d3e04326c367499fc3bbea6902239833d8521
7
- data.tar.gz: 968e6d6a478e2ec8ef34fe3651fb9c7badc6c1b6a5bf59c832a916ee3d48a398104fe6f64c47f275d082c72c609158b3bfdda802f1ced9de4bc1c3de9f9ffab5
6
+ metadata.gz: d3fa388e8d7f0673f5dff57fd123e4e1a0701b6e5b1ee004e6d557b8ea6fcb0c050cc9d9b3fe03904a67642781364600f549d1de4d1cda4fbbd9d623ded3f5e8
7
+ data.tar.gz: e13531ec7bf469de4f3dfd11a9895ff9cb9d260fc51ef292854352938b9297ddbbe3d634bb1d7d0cdc403ddcce0cba49e3fe3735799a2af13929d6cf29bd9409
@@ -1306,7 +1306,9 @@ module ChefConfig
1306
1306
  # sure Chef runs do not crash.
1307
1307
  # @api private
1308
1308
  def self.enable_fips_mode
1309
+ # Enable FIPS mode in OpenSSL.
1309
1310
  OpenSSL.fips_mode = true
1311
+
1310
1312
  require "digest" unless defined?(Digest)
1311
1313
  require "digest/sha1" unless defined?(Digest::SHA1)
1312
1314
  require "digest/md5" unless defined?(Digest::MD5)
@@ -1314,8 +1316,6 @@ module ChefConfig
1314
1316
  # amount of log spam and warnings.
1315
1317
  Digest.send(:remove_const, "SHA1") if Digest.const_defined?(:SHA1)
1316
1318
  Digest.const_set(:SHA1, OpenSSL::Digest::SHA1)
1317
- OpenSSL::Digest.send(:remove_const, "MD5") if OpenSSL::Digest.const_defined?(:MD5)
1318
- OpenSSL::Digest.const_set(:MD5, Digest::MD5)
1319
1319
  ChefConfig.logger.debug "FIPS mode is enabled."
1320
1320
  end
1321
1321
  end
@@ -42,6 +42,11 @@ module ChefConfig
42
42
  # Do greedy matching by adding wildcard if it is not specified
43
43
  match = "*" + match unless match.start_with?("*")
44
44
  Fuzzyurl.matches?(Fuzzyurl.mask(hostname: match), hostname)
45
+ rescue ArgumentError
46
+ # Fuzzyurl cannot parse certain URL formats, notably IPv6 addresses
47
+ # (bare, bracketed, or embedded in URLs). When parsing fails, the URL
48
+ # cannot match a no_proxy pattern, so return false.
49
+ false
45
50
  end
46
51
 
47
52
  end
@@ -15,5 +15,5 @@
15
15
 
16
16
  module ChefConfig
17
17
  CHEFCONFIG_ROOT = File.expand_path("..", __dir__)
18
- VERSION = "19.1.164".freeze
18
+ VERSION = "19.2.12".freeze
19
19
  end
@@ -0,0 +1,70 @@
1
+ #
2
+ # Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "spec_helper"
18
+ require "chef-config/mixin/fuzzy_hostname_matcher"
19
+
20
+ RSpec.describe ChefConfig::Mixin::FuzzyHostnameMatcher do
21
+ let(:matcher) do
22
+ Class.new { include ChefConfig::Mixin::FuzzyHostnameMatcher }.new
23
+ end
24
+
25
+ describe "#fuzzy_hostname_match?" do
26
+ it "matches a hostname with a wildcard pattern" do
27
+ expect(matcher.fuzzy_hostname_match?("foo.example.com", "example.com")).to be true
28
+ end
29
+
30
+ it "does not match unrelated hostnames" do
31
+ expect(matcher.fuzzy_hostname_match?("foo.example.com", "other.com")).to be false
32
+ end
33
+
34
+ it "returns false for bare IPv6 addresses instead of raising" do
35
+ expect(matcher.fuzzy_hostname_match?("2001:db8::1", "example.com")).to be false
36
+ end
37
+
38
+ it "returns false for bracketed IPv6 addresses instead of raising" do
39
+ expect(matcher.fuzzy_hostname_match?("[2001:db8::1]", "example.com")).to be false
40
+ end
41
+
42
+ it "returns false for IPv6 URLs instead of raising" do
43
+ expect(matcher.fuzzy_hostname_match?("https://[2001:db8::1]/path", "example.com")).to be false
44
+ end
45
+ end
46
+
47
+ describe "#fuzzy_hostname_match_any?" do
48
+ it "returns false when hostname is nil" do
49
+ expect(matcher.fuzzy_hostname_match_any?(nil, "example.com")).to be false
50
+ end
51
+
52
+ it "returns false when matches is nil" do
53
+ expect(matcher.fuzzy_hostname_match_any?("foo.example.com", nil)).to be false
54
+ end
55
+
56
+ it "matches against comma-separated patterns" do
57
+ expect(matcher.fuzzy_hostname_match_any?("foo.example.com", "other.com, example.com")).to be true
58
+ end
59
+
60
+ it "returns false for IPv6 URLs with hostname no_proxy patterns" do
61
+ ipv6_url = "https://[2001:db8:abcd:ef01::1]/organizations/o3"
62
+ no_proxy = "gateway.example.net,internal.example.com"
63
+ expect(matcher.fuzzy_hostname_match_any?(ipv6_url, no_proxy)).to be false
64
+ end
65
+
66
+ it "returns false for bare IPv6 with hostname no_proxy patterns" do
67
+ expect(matcher.fuzzy_hostname_match_any?("2001:db8::1", "example.com,other.net")).to be false
68
+ end
69
+ end
70
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 19.1.164
4
+ version: 19.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 19.1.164
18
+ version: 19.2.12
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 19.1.164
25
+ version: 19.2.12
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: mixlib-shellout
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -145,6 +145,7 @@ files:
145
145
  - spec/unit/config_spec.rb
146
146
  - spec/unit/credentials_spec.rb
147
147
  - spec/unit/fips_spec.rb
148
+ - spec/unit/fuzzy_hostname_matcher_spec.rb
148
149
  - spec/unit/path_helper_spec.rb
149
150
  - spec/unit/workstation_config_loader_spec.rb
150
151
  homepage: https://github.com/chef/chef