berkshelf 8.0.15 → 8.0.21
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/Gemfile +3 -0
- data/lib/berkshelf/community_rest.rb +2 -2
- data/lib/berkshelf/downloader.rb +7 -2
- data/lib/berkshelf/ssl_policies.rb +1 -1
- data/lib/berkshelf/version.rb +1 -1
- data/spec/unit/berkshelf/cached_cookbook_spec.rb +1 -1
- data/spec/unit/berkshelf/downloader_spec.rb +1 -1
- data/spec/unit/berkshelf/uploader_spec.rb +1 -1
- metadata +6 -21
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/metadata.rb +0 -2
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/templates/default/template.erb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/metadata.rb +0 -2
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/templates/default/template.erb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/metadata.rb +0 -2
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/templates/default/template.erb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f70d01359005c084d1481b29aa447f541456420f8d5b0050efc391978dd5b646
|
4
|
+
data.tar.gz: 47a1fcb983563b5b75c7bfe44abf111284129b4463d06d3d32881210df310f12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36dc3abfbde5d769ae5d2310e9a13738baff867e343f8fb560d649962564a9451689f2a4b3e3dff396e3de427968b78e98fad3bf466f2cc3fc6d721074e69f3
|
7
|
+
data.tar.gz: 2f788eb2b9ddbb243fef2c1f8e51ae7d9e5e57b4b1d3aec767d97822f50058dd63a792326977190a9a3d147b8847979fca2902411f1dc37d46d34ac0deb7f8c5
|
data/Gemfile
CHANGED
@@ -39,11 +39,11 @@ module Berkshelf
|
|
39
39
|
def is_gzip_file(path)
|
40
40
|
# You cannot write "\x1F\x8B" because the default encoding of
|
41
41
|
# ruby >= 1.9.3 is UTF-8 and 8B is an invalid in UTF-8.
|
42
|
-
|
42
|
+
File.binread(path, 2) == [0x1F, 0x8B].pack("C*")
|
43
43
|
end
|
44
44
|
|
45
45
|
def is_tar_file(path)
|
46
|
-
|
46
|
+
File.binread(path, 8, 257).to_s == "ustar\x0000"
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
data/lib/berkshelf/downloader.rb
CHANGED
@@ -152,7 +152,12 @@ module Berkshelf
|
|
152
152
|
unpack_dir = Pathname.new(tmp_dir) + "#{name}-#{version}"
|
153
153
|
|
154
154
|
url = remote_cookbook.location_path
|
155
|
-
|
155
|
+
begin
|
156
|
+
uri = URI.parse(url)
|
157
|
+
rescue URI::InvalidURIError
|
158
|
+
raise "Invalid URI: #{url}"
|
159
|
+
end
|
160
|
+
uri.open("rb") do |remote_file|
|
156
161
|
archive_path.open("wb") { |local_file| local_file.write remote_file.read }
|
157
162
|
end
|
158
163
|
|
@@ -186,7 +191,7 @@ module Berkshelf
|
|
186
191
|
resp = connection.get(cookbook_uri.request_uri + "&private_token=" + options["private_token"])
|
187
192
|
return nil unless resp.status == 200
|
188
193
|
|
189
|
-
open(archive_path, "wb") { |file| file.write(resp.body) }
|
194
|
+
File.open(archive_path, "wb") { |file| file.write(resp.body) }
|
190
195
|
|
191
196
|
Mixlib::Archive.new(archive_path).extract(unpack_dir)
|
192
197
|
|
@@ -30,7 +30,7 @@ module Berkshelf
|
|
30
30
|
|
31
31
|
def set_custom_certs
|
32
32
|
::Dir.glob("#{trusted_certs_dir}/{*.crt,*.pem}").each do |cert|
|
33
|
-
cert = OpenSSL::X509::Certificate.new(
|
33
|
+
cert = OpenSSL::X509::Certificate.new(File.read(cert))
|
34
34
|
add_trusted_cert(cert)
|
35
35
|
end
|
36
36
|
end
|
data/lib/berkshelf/version.rb
CHANGED
@@ -43,7 +43,7 @@ describe Berkshelf::CachedCookbook do
|
|
43
43
|
describe "::checksum" do
|
44
44
|
it "returns a checksum of the given filepath" do
|
45
45
|
path = fixtures_path.join("cookbooks", "example_cookbook-0.5.0", "README.md")
|
46
|
-
expected_md5 = if
|
46
|
+
expected_md5 = if File.binread(path).include?("\r\n")
|
47
47
|
# On windows, with git configured for auto crlf
|
48
48
|
"2414583f86c9eb68bdbb0be391939341"
|
49
49
|
else
|
@@ -15,7 +15,7 @@ module Berkshelf
|
|
15
15
|
|
16
16
|
let(:graph) { double(Lockfile::Graph, locks: {}) }
|
17
17
|
let(:self_signed_crt_path) { File.join(BERKS_SPEC_DATA, "trusted_certs") }
|
18
|
-
let(:self_signed_crt) { OpenSSL::X509::Certificate.new(
|
18
|
+
let(:self_signed_crt) { OpenSSL::X509::Certificate.new(File.read("#{self_signed_crt_path}/example.crt")) }
|
19
19
|
let(:cert_store) { OpenSSL::X509::Store.new.add_cert(self_signed_crt) }
|
20
20
|
let(:ssl_policy) { double(SSLPolicy, store: cert_store) }
|
21
21
|
|
@@ -15,7 +15,7 @@ module Berkshelf
|
|
15
15
|
|
16
16
|
let(:graph) { double(Lockfile::Graph, locks: {}) }
|
17
17
|
let(:self_signed_crt_path) { File.join(BERKS_SPEC_DATA, "trusted_certs") }
|
18
|
-
let(:self_signed_crt) { OpenSSL::X509::Certificate.new(
|
18
|
+
let(:self_signed_crt) { OpenSSL::X509::Certificate.new(File.read("#{self_signed_crt_path}/example.crt")) }
|
19
19
|
let(:cert_store) { OpenSSL::X509::Store.new.add_cert(self_signed_crt) }
|
20
20
|
let(:ssl_policy) { double(SSLPolicy, store: cert_store) }
|
21
21
|
|
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: 8.0.
|
4
|
+
version: 8.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
- Michael Ivey
|
10
10
|
- Justin Campbell
|
11
11
|
- Seth Vargo
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2025-05-14 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: mixlib-shellout
|
@@ -346,21 +346,6 @@ files:
|
|
346
346
|
- spec/support/matchers/filepath_matchers.rb
|
347
347
|
- spec/support/path_helpers.rb
|
348
348
|
- spec/support/shared_examples/formatter.rb
|
349
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.1.0/attributes/default.rb
|
350
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.1.0/files/default/file.h
|
351
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.1.0/metadata.rb
|
352
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.1.0/recipes/default.rb
|
353
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.1.0/templates/default/template.erb
|
354
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.2.0/attributes/default.rb
|
355
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.2.0/files/default/file.h
|
356
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.2.0/metadata.rb
|
357
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.2.0/recipes/default.rb
|
358
|
-
- spec/tmp/berkshelf/cookbooks/fake-0.2.0/templates/default/template.erb
|
359
|
-
- spec/tmp/berkshelf/cookbooks/fake-1.0.0/attributes/default.rb
|
360
|
-
- spec/tmp/berkshelf/cookbooks/fake-1.0.0/files/default/file.h
|
361
|
-
- spec/tmp/berkshelf/cookbooks/fake-1.0.0/metadata.rb
|
362
|
-
- spec/tmp/berkshelf/cookbooks/fake-1.0.0/recipes/default.rb
|
363
|
-
- spec/tmp/berkshelf/cookbooks/fake-1.0.0/templates/default/template.erb
|
364
349
|
- spec/unit/berkshelf/berksfile_spec.rb
|
365
350
|
- spec/unit/berkshelf/berkshelf/api_client/chef_server_connection_spec.rb
|
366
351
|
- spec/unit/berkshelf/berkshelf/api_client/connection_spec.rb
|
@@ -410,7 +395,7 @@ metadata:
|
|
410
395
|
bug_tracker_uri: https://github.com/chef/berkshelf/issues
|
411
396
|
source_code_uri: https://github.com/chef/berkshelf
|
412
397
|
changelog_uri: https://github.com/chef/berkshelf/blob/main/CHANGELOG.md
|
413
|
-
post_install_message:
|
398
|
+
post_install_message:
|
414
399
|
rdoc_options: []
|
415
400
|
require_paths:
|
416
401
|
- lib
|
@@ -425,8 +410,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
425
410
|
- !ruby/object:Gem::Version
|
426
411
|
version: 2.0.0
|
427
412
|
requirements: []
|
428
|
-
rubygems_version: 3.3.
|
429
|
-
signing_key:
|
413
|
+
rubygems_version: 3.3.27
|
414
|
+
signing_key:
|
430
415
|
specification_version: 4
|
431
416
|
summary: Manages a Chef cookbook's dependencies
|
432
417
|
test_files: []
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|