berkshelf 6.2.1 → 6.2.2

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: 25a14291bb2c9d50f4cb89888e7c71e4d06a4bef
4
- data.tar.gz: 1fae554e27d90927e4568a808a4694d520306d77
3
+ metadata.gz: 957ca7b1c871821c5d91be2ff270c37ad90044fa
4
+ data.tar.gz: 1af13dcc965672d9e31c53425150a1c6e24e9e55
5
5
  SHA512:
6
- metadata.gz: 91918e3d292165f595c98a4209eb9e88ad55305eb8e799b7b0af1e33512503332dd7bd2fc15e43b5abb1eb57221d46b2e8737814c9cf33e0f302a6eec86871f3
7
- data.tar.gz: 6c0bcf5fa299bfd5722432252aa91a5cde776674b13698f0c12335ec956a478ba59aca6bc08081e0c5223672f3c48fcc6dfaafc475942e7e47eb662217b0953d
6
+ metadata.gz: 1f1d111e55146320ac610f666ff5d27ce3e6bbaa91c7f53a4d350705698b61b3a0ae2cd2d383a9953c3e0a33ef21ee3bdfee33b5dcdc1ba5c69117e24e502d88
7
+ data.tar.gz: d32ad02c06048835d13552410b5764dfa79f976547ac96bac38e758327b5a138840af94f476a9db1c5dc042412bf0676ac0d5ab1daab7dc12bef381a12eeca93
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## [v6.2.1](https://github.com/berkshelf/berkshelf/tree/v6.2.1) (2017-07-18)
4
+ [Full Changelog](https://github.com/berkshelf/berkshelf/compare/v6.2.0...v6.2.1)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - remove berks-api dep [\#1712](https://github.com/berkshelf/berkshelf/pull/1712) ([lamont-granquist](https://github.com/lamont-granquist))
9
+ - pull berkshelf-api-client gem into berkshelf [\#1711](https://github.com/berkshelf/berkshelf/pull/1711) ([lamont-granquist](https://github.com/lamont-granquist))
10
+ - bump berkshelf-api-client dep to 4.0.1 [\#1710](https://github.com/berkshelf/berkshelf/pull/1710) ([lamont-granquist](https://github.com/lamont-granquist))
11
+
3
12
  ## [v6.2.0](https://github.com/berkshelf/berkshelf/tree/v6.2.0) (2017-06-22)
4
13
  [Full Changelog](https://github.com/berkshelf/berkshelf/compare/v6.1.1...v6.2.0)
5
14
 
@@ -325,7 +334,7 @@
325
334
  **Merged pull requests:**
326
335
 
327
336
  - Correct exclusion of metadata.rb [\#1339](https://github.com/berkshelf/berkshelf/pull/1339) ([rveznaver](https://github.com/rveznaver))
328
- - fix chefignore for files in sub directories [\#1335](https://github.com/berkshelf/berkshelf/pull/1335) ([triccardi-systran](https://github.com/triccardi-systran))
337
+ - fix chefignore for files in sub directories [\#1335](https://github.com/berkshelf/berkshelf/pull/1335) ([thomas-riccardi](https://github.com/thomas-riccardi))
329
338
  - Do not leak tempdirs [\#1334](https://github.com/berkshelf/berkshelf/pull/1334) ([sethvargo](https://github.com/sethvargo))
330
339
 
331
340
  ## [v3.2.0](https://github.com/berkshelf/berkshelf/tree/v3.2.0) (2014-10-29)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- berkshelf (6.2.1)
4
+ berkshelf (6.2.2)
5
5
  buff-config (~> 2.0)
6
6
  buff-extensions (~> 2.0)
7
7
  chef (>= 12.7.2)
@@ -168,8 +168,8 @@ GEM
168
168
  mixlib-cli (1.7.0)
169
169
  mixlib-config (2.2.4)
170
170
  mixlib-log (1.7.1)
171
- mixlib-shellout (2.2.7)
172
- molinillo (0.5.7)
171
+ mixlib-shellout (2.3.2)
172
+ molinillo (0.6.0)
173
173
  multi_json (1.12.1)
174
174
  multi_test (0.1.2)
175
175
  multipart-post (2.0.0)
@@ -271,7 +271,7 @@ GEM
271
271
  solve (3.1.0)
272
272
  molinillo (>= 0.5)
273
273
  semverse (>= 1.1, < 3.0)
274
- specinfra (2.69.0)
274
+ specinfra (2.70.0)
275
275
  net-scp
276
276
  net-ssh (>= 2.7, < 5.0)
277
277
  net-telnet
@@ -318,4 +318,4 @@ DEPENDENCIES
318
318
  yard (>= 0.8)
319
319
 
320
320
  BUNDLED WITH
321
- 1.15.1
321
+ 1.15.3
data/README.md CHANGED
@@ -66,8 +66,6 @@ Please see [Plugins page](https://github.com/berkshelf/berkshelf/blob/master/PLU
66
66
 
67
67
  ## Authors
68
68
 
69
- [The Berkshelf Core Team](https://github.com/berkshelf/berkshelf/wiki/Core-Team)
70
-
71
69
  Thank you to all of our [Contributors](https://github.com/berkshelf/berkshelf/graphs/contributors), testers, and users.
72
70
 
73
71
  If you'd like to contribute, please see our [contribution guidelines](https://github.com/berkshelf/berkshelf/blob/master/CONTRIBUTING.md) first.
@@ -47,8 +47,8 @@ The above is a trivial example. If your cookbook has several dependencies, whic
47
47
  ## What's in the background
48
48
 
49
49
  * the cookbook's `metadata.rb` specifies the cookbook dependencies and required versions
50
- * the [Berksfile](http://berkshelf.com/v2.0/#the-berksfile) in your cookbook's root directory tells Berkshelf where to find cookbooks. You can have multiple sources, or can pull individual cookbooks from specific locations, such as your own Supermarket, GitHub, or a file server.
51
- * `berks install` downloads cookbooks and their dependencies to the [Berkshelf](http://berkshelf.com/v2.0/#the-berkshelf), a place on your local disk.
50
+ * the [Berksfile](https://docs.chef.io/berkshelf.html#the-berksfile) in your cookbook's root directory tells Berkshelf where to find cookbooks. You can have multiple sources, or can pull individual cookbooks from specific locations, such as your own Supermarket, GitHub, or a file server.
51
+ * `berks install` downloads cookbooks and their dependencies to the [Berkshelf](https://docs.chef.io/berkshelf.html#berkshelf-cli), a place on your local disk.
52
52
  * a Berksfile.lock is generated on `berks install` which specifies the exact cookbook versions that were used at that point
53
53
 
54
54
  ## Cookbook versioning
@@ -57,8 +57,7 @@ Berkshelf relies on cookbook versioning to work correctly. A cookbook's version
57
57
 
58
58
  # Further reading
59
59
 
60
- * The project homepage, http://http://berkshelf.com/v2.0/
61
- * https://sethvargo.com/berkshelf-workflow/
60
+ * https://docs.chef.io/berkshelf.html
62
61
 
63
62
  --
64
63
 
@@ -2,23 +2,27 @@ require "chef/server_api"
2
2
  require "chef/http/simple_json"
3
3
  require "chef/http/simple"
4
4
  require "berkshelf/api_client/errors"
5
+ require "chef/config"
5
6
 
6
7
  module Berkshelf
7
8
  module RidleyCompatAPI
8
9
  def initialize(**opts)
9
10
  opts = opts.dup
10
11
  opts[:ssl] ||= {}
11
- chef_opts = {
12
- rest_timeout: opts[:timeout], # opts[:open_timeout] is ignored on purpose
13
- headers: opts[:headers],
14
- client_name: opts[:client_name],
15
- signing_key_filename: opts[:client_key],
16
- ssl_verify_mode: opts[:verify] ? :verify_none : :verify_peer,
17
- ssl_ca_path: opts[:ssl][:ca_path],
18
- ssl_ca_file: opts[:ssl][:ca_file],
19
- ssl_client_cert: opts[:ssl][:client_cert],
20
- ssl_client_key: opts[:ssl][:client_key],
21
- }
12
+ chef_opts = {}
13
+ chef_opts[:rest_timeout] = opts[:timeout] if opts[:timeout] # opts[:open_timeout] is ignored on purpose
14
+ chef_opts[:headers] = opts[:headers] if opts[:headers]
15
+ chef_opts[:client_name] = opts[:client_name] if opts[:client_name]
16
+ chef_opts[:signing_key_filename] = opts[:client_key] if opts[:client_key]
17
+ chef_opts[:verify_api_cert] = opts[:ssl][:verify] || opts[:ssl][:verify].nil?
18
+ chef_opts[:ssl_verify_mode] = chef_opts[:verify_api_cert] ? :verify_peer : :verify_none
19
+ chef_opts[:ssl_ca_path] = opts[:ssl][:ca_path] if opts[:ssl][:ca_path]
20
+ chef_opts[:ssl_ca_file] = opts[:ssl][:ca_file] if opts[:ssl][:ca_file]
21
+ chef_opts[:ssl_client_cert] = opts[:ssl][:client_cert] if opts[:ssl][:client_cert]
22
+ chef_opts[:ssl_client_key] = opts[:ssl][:client_key] if opts[:ssl][:client_key]
23
+ # chef/http/ssl_policies.rb reads only from Chef::Config and not from the opts in the constructor
24
+ Chef::Config[:verify_api_cert] = chef_opts[:verify_api_cert]
25
+ Chef::Config[:ssl_verify_mode] = chef_opts[:ssl_verify_mode]
22
26
  super(opts[:server_url].to_s, **chef_opts)
23
27
  end
24
28
 
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "6.2.1"
2
+ VERSION = "6.2.2"
3
3
  end
@@ -56,6 +56,63 @@ describe Berkshelf::APIClient::Connection do
56
56
  end
57
57
  end
58
58
 
59
+ describe "disabling ssl validation on requests" do
60
+ let(:instance) { described_class.new("https://supermarket.getchef.com", ssl: { verify: false }) }
61
+
62
+ before do
63
+ body_response = %q{{"ruby":{"1.2.3":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"},"2.0.0":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}},"elixir":{"1.0.0":{"endpoint_priority":0,"platforms":{"CentOS":"= 6.0.0"},"dependencies":{},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}}}}
64
+
65
+ stub_request(:get, "https://supermarket.getchef.com/universe")
66
+ .to_return(status: 200, body: body_response, headers: { "Content-Type" => "application/json; charset=utf-8" })
67
+ end
68
+
69
+ subject { instance.universe }
70
+
71
+ it "correctly disables SSL validation" do
72
+ expect_any_instance_of(Net::HTTP).to receive(:use_ssl=).with(true).and_call_original
73
+ expect_any_instance_of(Net::HTTP).to receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_NONE).and_call_original
74
+ expect(subject).to be_a(Array)
75
+ end
76
+ end
77
+
78
+ describe "enabling ssl validation on requests" do
79
+ let(:instance) { described_class.new("https://supermarket.getchef.com", ssl: { verify: true }) }
80
+
81
+ before do
82
+ body_response = %q{{"ruby":{"1.2.3":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"},"2.0.0":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}},"elixir":{"1.0.0":{"endpoint_priority":0,"platforms":{"CentOS":"= 6.0.0"},"dependencies":{},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}}}}
83
+
84
+ stub_request(:get, "https://supermarket.getchef.com/universe")
85
+ .to_return(status: 200, body: body_response, headers: { "Content-Type" => "application/json; charset=utf-8" })
86
+ end
87
+
88
+ subject { instance.universe }
89
+
90
+ it "correctly disables SSL validation" do
91
+ expect_any_instance_of(Net::HTTP).to receive(:use_ssl=).with(true).and_call_original
92
+ expect_any_instance_of(Net::HTTP).to receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER).and_call_original
93
+ expect(subject).to be_a(Array)
94
+ end
95
+ end
96
+
97
+ describe "enabling ssl validation by default" do
98
+ let(:instance) { described_class.new("https://supermarket.getchef.com") }
99
+
100
+ before do
101
+ body_response = %q{{"ruby":{"1.2.3":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"},"2.0.0":{"endpoint_priority":0,"platforms":{},"dependencies":{"build-essential":">= 1.2.2"},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}},"elixir":{"1.0.0":{"endpoint_priority":0,"platforms":{"CentOS":"= 6.0.0"},"dependencies":{},"location_type":"supermarket","location_path":"https://supermarket.getchef.com/"}}}}
102
+
103
+ stub_request(:get, "https://supermarket.getchef.com/universe")
104
+ .to_return(status: 200, body: body_response, headers: { "Content-Type" => "application/json; charset=utf-8" })
105
+ end
106
+
107
+ subject { instance.universe }
108
+
109
+ it "correctly disables SSL validation" do
110
+ expect_any_instance_of(Net::HTTP).to receive(:use_ssl=).with(true).and_call_original
111
+ expect_any_instance_of(Net::HTTP).to receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER).and_call_original
112
+ expect(subject).to be_a(Array)
113
+ end
114
+ end
115
+
59
116
  describe "non-200s" do
60
117
  before do
61
118
  Chef::Config[:http_retry_delay] = 0.001
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.1
4
+ version: 6.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Winsor
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-07-18 00:00:00.000000000 Z
15
+ date: 2017-08-02 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: buff-config