omnibus 6.0.24 → 6.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omnibus/fetchers/net_fetcher.rb +1 -0
- data/lib/omnibus/software.rb +3 -1
- data/lib/omnibus/version.rb +1 -1
- data/spec/unit/fetchers/net_fetcher_spec.rb +28 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e008e08071c850bbd9e8021ce0eb22eb8415aaba92060de5380b399de8841fe
|
4
|
+
data.tar.gz: 0260e33da4bf4a91ad49e96d8e3c0f08f9f233b8e4eb58b40208c9e8e126b34b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8b30760147a6adf9919e3fce9e34c21d7b5045f6a646f02b4c3ad7f0e35f71ee8589697618088d938e701ead1336c4f93c02a96649ad8133d5d489b098d9ca9
|
7
|
+
data.tar.gz: 1a72c335607d61739ca95d8954f5b745fa990329e1cc3459460c479273d1345c8ca1c70197f1fd8ae4b5c361163108ebf1dabef69317a050d5f7b6ebe7a67664
|
@@ -171,6 +171,7 @@ module Omnibus
|
|
171
171
|
|
172
172
|
# Set the cookie if one was given
|
173
173
|
options["Cookie"] = source[:cookie] if source[:cookie]
|
174
|
+
options["Authorization"] = source[:authorization] if source[:authorization]
|
174
175
|
|
175
176
|
download_file!(download_url, downloaded_file, options)
|
176
177
|
end
|
data/lib/omnibus/software.rb
CHANGED
@@ -263,6 +263,8 @@ module Omnibus
|
|
263
263
|
#
|
264
264
|
# @option val [String] :cookie (nil)
|
265
265
|
# a cookie to set
|
266
|
+
# @option val [String] :authorization (nil)
|
267
|
+
# an authorization header to set
|
266
268
|
# @option val [String] :warning (nil)
|
267
269
|
# a warning message to print when downloading
|
268
270
|
# @option val [Symbol] :extract (nil)
|
@@ -294,7 +296,7 @@ module Omnibus
|
|
294
296
|
extra_keys = val.keys - [
|
295
297
|
:git, :file, :path, :url, # fetcher types
|
296
298
|
:md5, :sha1, :sha256, :sha512, # hash type - common to all fetchers
|
297
|
-
:cookie, :warning, :unsafe, :extract, :cached_name, # used by net_fetcher
|
299
|
+
:cookie, :warning, :unsafe, :extract, :cached_name, :authorization, # used by net_fetcher
|
298
300
|
:options, # used by path_fetcher
|
299
301
|
:submodules # used by git_fetcher
|
300
302
|
]
|
data/lib/omnibus/version.rb
CHANGED
@@ -25,6 +25,34 @@ module Omnibus
|
|
25
25
|
|
26
26
|
subject { described_class.new(manifest_entry, project_dir, build_dir) }
|
27
27
|
|
28
|
+
describe "authorization" do
|
29
|
+
context "when none passed" do
|
30
|
+
it "does not get passed" do
|
31
|
+
expect(subject).to receive(:download_file!) do |url_arg, path_arg, options_arg|
|
32
|
+
expect(options_arg).to_not have_key("Authorization")
|
33
|
+
end
|
34
|
+
|
35
|
+
subject.send(:download)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context "when passed" do
|
40
|
+
let(:auth_header) { "a fake auth header" }
|
41
|
+
let(:source) do
|
42
|
+
{ url: "https://get.example.com/file.tar.gz", md5: "abcd1234", authorization: auth_header }
|
43
|
+
end
|
44
|
+
|
45
|
+
it "does get passed" do
|
46
|
+
expect(subject).to receive(:download_file!) do |url_arg, path_arg, options_arg|
|
47
|
+
expect(options_arg).to have_key("Authorization")
|
48
|
+
expect(options_arg["Authorization"]).to eq(auth_header)
|
49
|
+
end
|
50
|
+
|
51
|
+
subject.send(:download)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
28
56
|
describe "#fetch_required?" do
|
29
57
|
context "when file is not downloaded" do
|
30
58
|
before { allow(File).to receive(:exist?).and_return(false) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnibus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|