uricp 0.0.30 → 0.0.32
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 +14 -4
- data/lib/uricp/strategy/piped_remote_get.rb +4 -1
- 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: 2b5228be7d35d62611b6e047bbcb950cc790dd900e0df5f4b85dbc81fc484fd2
|
4
|
+
data.tar.gz: 4abb4b519a0293050b61a149a864efe4767ceff27ea8fad63a8bf245084301d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a354b1464046bdc6227145c1b8eba717437e9d51ea5d2d236e108ee81a8ac0972a5d3dec987a883eff0fc35d220453ce1afa1fffcc7e3ec3d2b8f97abab85442
|
7
|
+
data.tar.gz: 7f40a3b357f447a6b1f8201c320def28f93772ec9ff63f64a8e4b2dbf08b4a1cbb91ce3aa6a318ede61c43075da791cbc6c18109734828ffb294bc09185c0432
|
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
|
@@ -24,22 +25,31 @@ module Uricp::CurlPrimitives
|
|
24
25
|
end
|
25
26
|
|
26
27
|
def authentication
|
27
|
-
"-H X-Auth-Token:#{options['authenticator'].call}" if http_authentication?
|
28
|
+
"-H 'X-Auth-Token:#{options['authenticator'].call}'" if http_authentication?
|
28
29
|
end
|
29
30
|
|
30
31
|
def http_authentication?
|
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
|
+
|
40
|
+
def temp_url?
|
41
|
+
from && from.query.to_s.include?('temp_url')
|
42
|
+
end
|
43
|
+
|
34
44
|
def curl_upload_from(source, destination = to)
|
35
|
-
"#{curl_command} #{authentication} -T #{source} #{destination};"
|
45
|
+
"#{curl_command} #{authentication} -T '#{source}' '#{destination}';"
|
36
46
|
end
|
37
47
|
|
38
48
|
def curl_download_to_pipe
|
39
|
-
"#{curl_command} #{authentication} #{from} |"
|
49
|
+
"#{curl_command} #{authentication if orbit?(from) && !temp_url?} '#{from}' |"
|
40
50
|
end
|
41
51
|
|
42
52
|
def curl_manifest(object_manifest, destination = to)
|
43
|
-
"#{curl_command} #{authentication} -X PUT -H 'X-Object-Manifest: #{object_manifest}' #{destination} --data-binary ''"
|
53
|
+
"#{curl_command} #{authentication} -X PUT -H 'X-Object-Manifest: #{object_manifest}' '#{destination}' --data-binary ''"
|
44
54
|
end
|
45
55
|
end
|
@@ -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,7 +76,9 @@ module Uricp::Strategy
|
|
75
76
|
|
76
77
|
def headers
|
77
78
|
headers = { 'Range' => 'bytes=0-7' }
|
78
|
-
|
79
|
+
if http_authentication? && orbit?(from) && !temp_url?
|
80
|
+
headers['X-Auth-Token'] = options['authenticator'].call
|
81
|
+
end
|
79
82
|
headers
|
80
83
|
end
|
81
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.32
|
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-
|
11
|
+
date: 2022-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|