dpl-s3 1.10.2.travis.2976.6 → 1.10.2.travis.2979.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dpl/provider/s3.rb +9 -1
- data/spec/provider/s3_spec.rb +18 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa36d806b305e35eece1da326f24375d4103de6f2172f56ce98974bd4477e8e
|
4
|
+
data.tar.gz: c86dd1c62adf149e8cdc17b2f411e4b8c25cfce0fe231f86c516839765d3d479
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a40869944d2f57f371dd469d90e5044324fb46dac0cbcde8d3c385cd12d0c0c65e5cf7ebb2bf4589311bd7b39d8d15921b8a17db51e631b91e115aea4bece8c8
|
7
|
+
data.tar.gz: 081b10aa0892dcfbcbb5acc177ae6c783c0b36f19aafa9c9e4e55a44cc39585c507cdc991551426daaef07b3b39930dc1cad5b414845b47dcf3f889532d751ea
|
data/lib/dpl/provider/s3.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'aws-sdk'
|
3
3
|
require 'mime-types'
|
4
|
+
require 'uri'
|
4
5
|
|
5
6
|
Aws.eager_autoload!
|
6
7
|
|
@@ -44,7 +45,14 @@ module DPL
|
|
44
45
|
credentials: ::Aws::Credentials.new(access_key_id, secret_access_key)
|
45
46
|
}
|
46
47
|
|
47
|
-
|
48
|
+
if options[:endpoint]
|
49
|
+
uri = URI.parse(options[:endpoint])
|
50
|
+
unless uri.scheme
|
51
|
+
log "S3 endpoint does not specify scheme; defaulting to HTTPS"
|
52
|
+
uri = URI("https://#{options[:endpoint]}")
|
53
|
+
end
|
54
|
+
defaults[:endpoint] = uri.to_s
|
55
|
+
end
|
48
56
|
|
49
57
|
defaults
|
50
58
|
end
|
data/spec/provider/s3_spec.rb
CHANGED
@@ -23,6 +23,24 @@ describe DPL::Provider::S3 do
|
|
23
23
|
expect(options[:region]).to eq(region)
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
context 'with endpoint no https' do
|
28
|
+
example do
|
29
|
+
endpoint = 'myendpoint.com'
|
30
|
+
provider.options.update(:endpoint => endpoint)
|
31
|
+
options = provider.s3_options
|
32
|
+
expect(options[:endpoint]).to eq("https://#{endpoint}")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'with endpoint with https' do
|
37
|
+
example do
|
38
|
+
endpoint = 'https://myendpoint.com'
|
39
|
+
provider.options.update(:endpoint => endpoint)
|
40
|
+
options = provider.s3_options
|
41
|
+
expect(options[:endpoint]).to eq(endpoint)
|
42
|
+
end
|
43
|
+
end
|
26
44
|
end
|
27
45
|
end
|
28
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.2.travis.
|
4
|
+
version: 1.10.2.travis.2979.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dpl
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.10.2.travis.
|
19
|
+
version: 1.10.2.travis.2979.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.10.2.travis.
|
26
|
+
version: 1.10.2.travis.2979.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aws-sdk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|