uricp 0.0.31 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/uricp/curl_primitives.rb +8 -2
- data/lib/uricp/strategy/piped_remote_get.rb +4 -2
- data/lib/uricp/version.rb +1 -1
- 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: 5646c45d26dfa89933ac2cb28089ac771dff6a43719fcaba2304e741060a0b7f
|
4
|
+
data.tar.gz: 05172e7eab7420dc2b393ad93328d0250c2ae804b4fb3c1707c87e3f11d5180b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8830466e53007d4f2459a610978fb458e7771e8bdd7af61a69b502b42247b68f98b50801c900d7798437f4e56d4aadfe5ceeb9d4e946856c5c969b043bb1ac
|
7
|
+
data.tar.gz: 57a7b66754c00b8fd48d4c8149fbbe47357ff9e7033013f9b5f33735c179a7350e1bd815e83ef03d68f8e9323c1615a853fafbe1031ad115f15dd7fa07b89c22
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Uricp::CurlPrimitives
|
4
|
+
ORBIT_HOSTS = %w[orbit.brightbox.com orbit.gb1s.brightbox.com]
|
4
5
|
attr_reader :options
|
5
6
|
|
6
7
|
def from
|
@@ -20,7 +21,7 @@ module Uricp::CurlPrimitives
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def curl_command
|
23
|
-
'curl --fail --silent'
|
24
|
+
'curl --fail --silent --location '
|
24
25
|
end
|
25
26
|
|
26
27
|
def authentication
|
@@ -31,6 +32,11 @@ module Uricp::CurlPrimitives
|
|
31
32
|
options['authenticator']
|
32
33
|
end
|
33
34
|
|
35
|
+
def orbit?(source)
|
36
|
+
return unless source.respond_to?(:host)
|
37
|
+
ORBIT_HOSTS.include?(source.host)
|
38
|
+
end
|
39
|
+
|
34
40
|
def temp_url?
|
35
41
|
from && from.query.to_s.include?('temp_url')
|
36
42
|
end
|
@@ -40,7 +46,7 @@ module Uricp::CurlPrimitives
|
|
40
46
|
end
|
41
47
|
|
42
48
|
def curl_download_to_pipe
|
43
|
-
"#{curl_command} #{authentication
|
49
|
+
"#{curl_command} #{authentication if orbit?(from) && !temp_url?} '#{from}' |"
|
44
50
|
end
|
45
51
|
|
46
52
|
def curl_manifest(object_manifest, destination = to)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'open-uri'
|
4
|
+
require 'socket'
|
4
5
|
module Uricp::Strategy
|
5
6
|
class PipedRemoteGet
|
6
7
|
include Uricp::Strategy::Common
|
@@ -75,8 +76,9 @@ module Uricp::Strategy
|
|
75
76
|
|
76
77
|
def headers
|
77
78
|
headers = { 'Range' => 'bytes=0-7' }
|
78
|
-
|
79
|
-
|
79
|
+
if http_authentication? && orbit?(from) && !temp_url?
|
80
|
+
headers['X-Auth-Token'] = options['authenticator'].call
|
81
|
+
end
|
80
82
|
headers
|
81
83
|
end
|
82
84
|
end
|
data/lib/uricp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uricp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|