chef-config 12.13.37 → 12.14.60

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
  SHA1:
3
- metadata.gz: 057458f594114dbb5d76620dbd646a96d0450ffa
4
- data.tar.gz: 11b7cd5be4c1c0742fe5072b522aeddfc111dfc0
3
+ metadata.gz: 8f0310c0333002b81e02894cb156d76fb4766eed
4
+ data.tar.gz: 9c85269868058c8fe69057ab222cff8fffbf89c2
5
5
  SHA512:
6
- metadata.gz: f5eaccdce2bceb76926b7b6a96a623ce8b390f645d42172eafaf92c2b5cdccbf3f97a6044c2a71b097714a69ae6a9c1d994dace24de3ccf5f8df4b9c75256449
7
- data.tar.gz: 5249082a43abb467535d65f225c20b0a31f0091fa1ea0fdde8816417360d9eda38832d52e1306b83a314647a914a08335263c8193e8e21d97a89b643eff8c682
6
+ metadata.gz: 2d1a5082efadbced1482919dc1e1b456e17a94f56b62d9d78f680c2d1b1fff431654c861aeb4739066d2441f73cbb838a436bf84139f2944ed879d2c38feeefd
7
+ data.tar.gz: 4f78359931c5ad8510ee9f42fc09f82c1be3d700b39f6e752ed63db88252d3909fc160fbdc8201c47f5cf4b244cf82f06f635886fa35e44858481545730c179b
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.add_dependency "mixlib-shellout", "~> 2.0"
19
19
  spec.add_dependency "mixlib-config", "~> 2.0"
20
20
  spec.add_dependency "fuzzyurl"
21
+ spec.add_dependency "addressable"
21
22
 
22
23
  spec.add_development_dependency "rake", "~> 10.0"
23
24
 
@@ -30,6 +30,7 @@ require "chef-config/mixin/fuzzy_hostname_matcher"
30
30
 
31
31
  require "mixlib/shellout"
32
32
  require "uri"
33
+ require "addressable/uri"
33
34
  require "openssl"
34
35
 
35
36
  module ChefConfig
@@ -660,6 +661,20 @@ module ChefConfig
660
661
 
661
662
  # knife configuration data
662
663
  config_context :knife do
664
+ # XXX: none of these default values are applied to knife (and would create a backcompat
665
+ # break in knife if this bug was fixed since many of the defaults below are wrong). this appears
666
+ # to be the start of an attempt to be able to use config_strict_mode true? if so, this approach
667
+ # is fraught with peril because this namespace is used by every knife plugin in the wild and
668
+ # we would need to validate every cli option in every knife attribute out there and list them all here.
669
+ #
670
+ # based on the way that people may define `knife[:foobar] = "something"` for the knife-foobar
671
+ # gem plugin i'm pretty certain we can never turn on anything like config_string_mode since
672
+ # any config value may be a typo or it may be in some gem in some knife plugin we don't know about.
673
+ #
674
+ # we do still need to maintain at least one of these so that the knife config hash gets
675
+ # created.
676
+ #
677
+ # this whole situation is deeply unsatisfying.
663
678
  default :ssh_port, nil
664
679
  default :ssh_user, nil
665
680
  default :ssh_attribute, nil
@@ -791,6 +806,11 @@ module ChefConfig
791
806
  default :normal_attribute_whitelist, nil
792
807
  default :override_attribute_whitelist, nil
793
808
 
809
+ # Pull down all the rubygems versions from rubygems and cache them the first time we do a gem_package or
810
+ # chef_gem install. This is memory-expensive and will grow without bounds, but will reduce network
811
+ # round trips.
812
+ default :rubygems_cache_enabled, false
813
+
794
814
  config_context :windows_service do
795
815
  # Set `watchdog_timeout` to the number of seconds to wait for a chef-client run
796
816
  # to finish
@@ -865,6 +885,13 @@ module ChefConfig
865
885
  export_no_proxy(no_proxy) if no_proxy
866
886
  end
867
887
 
888
+ # Character classes for Addressable
889
+ # See https://www.ietf.org/rfc/rfc3986.txt 3.2.1
890
+ # The user part may not have a : in it
891
+ USER = Addressable::URI::CharacterClasses::UNRESERVED + Addressable::URI::CharacterClasses::SUB_DELIMS
892
+ # The password part may have any valid USERINFO characters
893
+ PASSWORD = USER + "\\:"
894
+
868
895
  # Builds a proxy uri and exports it to the appropriate environment variables. Examples:
869
896
  # http://username:password@hostname:port
870
897
  # https://username@hostname:port
@@ -879,19 +906,17 @@ module ChefConfig
879
906
  path = "#{scheme}://#{path}" unless path.include?("://")
880
907
  # URI.split returns the following parts:
881
908
  # [scheme, userinfo, host, port, registry, path, opaque, query, fragment]
882
- parts = URI.split(URI.encode(path))
883
- # URI::Generic.build requires an integer for the port, but URI::split gives
884
- # returns a string for the port.
885
- parts[3] = parts[3].to_i if parts[3]
909
+ uri = Addressable::URI.encode(path, Addressable::URI)
910
+
886
911
  if user && !user.empty?
887
- userinfo = URI.encode(URI.encode(user), "@:")
912
+ userinfo = Addressable::URI.encode_component(user, USER)
888
913
  if pass
889
- userinfo << ":#{URI.encode(URI.encode(pass), '@:')}"
914
+ userinfo << ":#{Addressable::URI.encode_component(pass, PASSWORD)}"
890
915
  end
891
- parts[1] = userinfo
916
+ uri.userinfo = userinfo
892
917
  end
893
918
 
894
- path = URI::Generic.build(parts).to_s
919
+ path = uri.to_s
895
920
  ENV["#{scheme}_proxy".downcase] = path unless ENV["#{scheme}_proxy".downcase]
896
921
  ENV["#{scheme}_proxy".upcase] = path unless ENV["#{scheme}_proxy".upcase]
897
922
  end
@@ -21,9 +21,9 @@ module ChefConfig
21
21
  module FuzzyHostnameMatcher
22
22
 
23
23
  def fuzzy_hostname_match_any?(hostname, matches)
24
- return matches.to_s.split(/\s*,\s*/).compact.any? {
25
- |m| fuzzy_hostname_match?(hostname, m)
26
- } if (hostname != nil) && (matches != nil)
24
+ return matches.to_s.split(/\s*,\s*/).compact.any? do |m|
25
+ fuzzy_hostname_match?(hostname, m)
26
+ end if (hostname != nil) && (matches != nil)
27
27
 
28
28
  false
29
29
  end
@@ -182,7 +182,7 @@ module ChefConfig
182
182
  IO.write(version_file_path, new_version)
183
183
  end
184
184
 
185
- def update_version_rb
185
+ def update_version_rb # rubocop:disable Lint/NestedMethodDefinition
186
186
  puts "Updating #{version_rb_path} to include version #{version} ..."
187
187
  contents = <<-VERSION_RB
188
188
  # Copyright:: Copyright 2010-2016, Chef Software, Inc.
@@ -223,7 +223,7 @@ end
223
223
  IO.write(version_rb_path, contents)
224
224
  end
225
225
 
226
- def update_gemfile_lock
226
+ def update_gemfile_lock # rubocop:disable Lint/NestedMethodDefinition
227
227
  if File.exist?(gemfile_lock_path)
228
228
  puts "Updating #{gemfile_lock_path} to include version #{version} ..."
229
229
  contents = IO.read(gemfile_lock_path)
@@ -21,7 +21,7 @@
21
21
 
22
22
  module ChefConfig
23
23
  CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__)
24
- VERSION = "12.13.37"
24
+ VERSION = "12.14.60"
25
25
  end
26
26
 
27
27
  #
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: 12.13.37
4
+ version: 12.14.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: addressable
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement