fog-aws 3.9.0 → 3.12.0
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/CHANGELOG.md +225 -17
- data/README.md +1 -1
- data/fog-aws.gemspec +5 -4
- data/lib/fog/aws/compute.rb +6 -3
- data/lib/fog/aws/credential_fetcher.rb +14 -7
- data/lib/fog/aws/models/compute/security_group.rb +13 -5
- data/lib/fog/aws/models/compute/server.rb +2 -0
- data/lib/fog/aws/models/storage/file.rb +13 -10
- data/lib/fog/aws/parsers/compute/describe_security_groups.rb +18 -4
- data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +15 -0
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -0
- data/lib/fog/aws/requests/compute/run_instances.rb +44 -0
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +18 -8
- data/lib/fog/aws/requests/storage/get_object.rb +1 -1
- data/lib/fog/aws/storage.rb +42 -3
- data/lib/fog/aws/version.rb +1 -1
- data/tests/credentials_tests.rb +41 -0
- data/tests/models/storage/directory_tests.rb +113 -2
- data/tests/requests/compute/security_group_tests.rb +12 -1
- data/tests/requests/storage/bucket_tests.rb +1 -1
- data/tests/requests/storage/versioning_tests.rb +38 -0
- metadata +11 -22
- data/.gitignore +0 -17
- data/.travis.yml +0 -124
- data/Gemfile +0 -14
- data/Rakefile +0 -14
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/gemfiles/Gemfile-edge +0 -14
- data/gemfiles/Gemfile-ruby-2.0 +0 -7
- data/lib/fog/aws/iam/default_policies.json +0 -1574
- data/lib/fog/aws/iam/default_policy_versions.json +0 -3373
- data/stale.yml +0 -17
data/lib/fog/aws/storage.rb
CHANGED
@@ -14,6 +14,9 @@ module Fog
|
|
14
14
|
'https' => 443
|
15
15
|
}
|
16
16
|
|
17
|
+
MIN_MULTIPART_CHUNK_SIZE = 5242880
|
18
|
+
MAX_SINGLE_PUT_SIZE = 5368709120
|
19
|
+
|
17
20
|
VALID_QUERY_KEYS = %w[
|
18
21
|
acl
|
19
22
|
cors
|
@@ -43,7 +46,7 @@ module Fog
|
|
43
46
|
]
|
44
47
|
|
45
48
|
requires :aws_access_key_id, :aws_secret_access_key
|
46
|
-
recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname
|
49
|
+
recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname, :max_put_chunk_size, :max_copy_chunk_size
|
47
50
|
|
48
51
|
secrets :aws_secret_access_key, :hmac
|
49
52
|
|
@@ -117,6 +120,17 @@ module Fog
|
|
117
120
|
module Utils
|
118
121
|
attr_accessor :region
|
119
122
|
|
123
|
+
# Amazon S3 limits max chunk size that can be uploaded/copied in a single request to 5GB.
|
124
|
+
# Other S3-compatible storages (like, Ceph) do not have such limit.
|
125
|
+
# Ceph shows much better performance when file is copied as a whole, in a single request.
|
126
|
+
# fog-aws user can use these settings to configure chunk sizes.
|
127
|
+
# A non-positive value will tell fog-aws to use a single put/copy request regardless of file size.
|
128
|
+
#
|
129
|
+
# @return [Integer]
|
130
|
+
# @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/copy-object.html
|
131
|
+
attr_reader :max_put_chunk_size
|
132
|
+
attr_reader :max_copy_chunk_size
|
133
|
+
|
120
134
|
def cdn
|
121
135
|
@cdn ||= Fog::AWS::CDN.new(
|
122
136
|
:aws_access_key_id => @aws_access_key_id,
|
@@ -171,6 +185,12 @@ module Fog
|
|
171
185
|
params_to_url(params)
|
172
186
|
end
|
173
187
|
|
188
|
+
# @param value [int]
|
189
|
+
# @param description [str]
|
190
|
+
def validate_chunk_size(value, description)
|
191
|
+
raise "#{description} (#{value}) is less than minimum #{MIN_MULTIPART_CHUNK_SIZE}" unless value <= 0 || value >= MIN_MULTIPART_CHUNK_SIZE
|
192
|
+
end
|
193
|
+
|
174
194
|
private
|
175
195
|
|
176
196
|
def validate_signature_version!
|
@@ -179,6 +199,16 @@ module Fog
|
|
179
199
|
end
|
180
200
|
end
|
181
201
|
|
202
|
+
def init_max_put_chunk_size!(options = {})
|
203
|
+
@max_put_chunk_size = options.fetch(:max_put_chunk_size, MAX_SINGLE_PUT_SIZE)
|
204
|
+
validate_chunk_size(@max_put_chunk_size, 'max_put_chunk_size')
|
205
|
+
end
|
206
|
+
|
207
|
+
def init_max_copy_chunk_size!(options = {})
|
208
|
+
@max_copy_chunk_size = options.fetch(:max_copy_chunk_size, MAX_SINGLE_PUT_SIZE)
|
209
|
+
validate_chunk_size(@max_copy_chunk_size, 'max_copy_chunk_size')
|
210
|
+
end
|
211
|
+
|
182
212
|
def v4_signed_params_for_url(params, expires)
|
183
213
|
now = Fog::Time.now
|
184
214
|
|
@@ -284,10 +314,10 @@ module Fog
|
|
284
314
|
path_style = params.fetch(:path_style, @path_style)
|
285
315
|
if !path_style
|
286
316
|
if COMPLIANT_BUCKET_NAMES !~ bucket_name
|
287
|
-
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see:
|
317
|
+
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html")
|
288
318
|
path_style = true
|
289
319
|
elsif scheme == 'https' && !path_style && bucket_name =~ /\./
|
290
|
-
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see:
|
320
|
+
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html")
|
291
321
|
path_style = true
|
292
322
|
end
|
293
323
|
end
|
@@ -298,6 +328,8 @@ module Fog
|
|
298
328
|
host = params.fetch(:cname, bucket_name)
|
299
329
|
elsif path_style
|
300
330
|
path = bucket_to_path bucket_name, path
|
331
|
+
elsif host.start_with?("#{bucket_name}.")
|
332
|
+
# no-op
|
301
333
|
else
|
302
334
|
host = [bucket_name, host].join('.')
|
303
335
|
end
|
@@ -450,6 +482,10 @@ module Fog
|
|
450
482
|
|
451
483
|
|
452
484
|
@path_style = options[:path_style] || false
|
485
|
+
|
486
|
+
init_max_put_chunk_size!(options)
|
487
|
+
init_max_copy_chunk_size!(options)
|
488
|
+
|
453
489
|
@signature_version = options.fetch(:aws_signature_version, 4)
|
454
490
|
validate_signature_version!
|
455
491
|
setup_credentials(options)
|
@@ -513,6 +549,9 @@ module Fog
|
|
513
549
|
validate_signature_version!
|
514
550
|
@path_style = options[:path_style] || false
|
515
551
|
|
552
|
+
init_max_put_chunk_size!(options)
|
553
|
+
init_max_copy_chunk_size!(options)
|
554
|
+
|
516
555
|
@region = options[:region] || DEFAULT_REGION
|
517
556
|
|
518
557
|
if @endpoint = options[:endpoint]
|
data/lib/fog/aws/version.rb
CHANGED
data/tests/credentials_tests.rb
CHANGED
@@ -83,6 +83,7 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|
83
83
|
aws_secret_access_key: 'dummysecret',
|
84
84
|
aws_session_token: 'dummytoken',
|
85
85
|
region: 'us-west-1',
|
86
|
+
sts_endpoint: "https://sts.amazonaws.com",
|
86
87
|
aws_credentials_expire_at: expires_at
|
87
88
|
) { Fog::AWS::Compute.fetch_credentials(use_iam_profile: true) }
|
88
89
|
end
|
@@ -95,10 +96,50 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|
95
96
|
aws_secret_access_key: 'dummysecret',
|
96
97
|
aws_session_token: 'dummytoken',
|
97
98
|
region: 'us-west-1',
|
99
|
+
sts_endpoint: "https://sts.amazonaws.com",
|
100
|
+
aws_credentials_expire_at: expires_at
|
101
|
+
) { Fog::AWS::Compute.fetch_credentials(use_iam_profile: true, region: 'us-west-1') }
|
102
|
+
end
|
103
|
+
|
104
|
+
ENV["AWS_STS_REGIONAL_ENDPOINTS"] = "regional"
|
105
|
+
|
106
|
+
tests('#fetch_credentials with no region specified') do
|
107
|
+
returns(
|
108
|
+
aws_access_key_id: 'dummykey',
|
109
|
+
aws_secret_access_key: 'dummysecret',
|
110
|
+
aws_session_token: 'dummytoken',
|
111
|
+
region: 'us-west-1',
|
112
|
+
sts_endpoint: "https://sts.amazonaws.com",
|
113
|
+
aws_credentials_expire_at: expires_at
|
114
|
+
) { Fog::AWS::Compute.fetch_credentials(use_iam_profile: true) }
|
115
|
+
end
|
116
|
+
|
117
|
+
tests('#fetch_credentials with regional STS endpoint') do
|
118
|
+
returns(
|
119
|
+
aws_access_key_id: 'dummykey',
|
120
|
+
aws_secret_access_key: 'dummysecret',
|
121
|
+
aws_session_token: 'dummytoken',
|
122
|
+
region: 'us-west-1',
|
123
|
+
sts_endpoint: "https://sts.us-west-1.amazonaws.com",
|
124
|
+
aws_credentials_expire_at: expires_at
|
125
|
+
) { Fog::AWS::Compute.fetch_credentials(use_iam_profile: true, region: 'us-west-1') }
|
126
|
+
end
|
127
|
+
|
128
|
+
ENV["AWS_DEFAULT_REGION"] = "us-west-1"
|
129
|
+
|
130
|
+
tests('#fetch_credentials with regional STS endpoint with region in env') do
|
131
|
+
returns(
|
132
|
+
aws_access_key_id: 'dummykey',
|
133
|
+
aws_secret_access_key: 'dummysecret',
|
134
|
+
aws_session_token: 'dummytoken',
|
135
|
+
region: 'us-west-1',
|
136
|
+
sts_endpoint: "https://sts.us-west-1.amazonaws.com",
|
98
137
|
aws_credentials_expire_at: expires_at
|
99
138
|
) { Fog::AWS::Compute.fetch_credentials(use_iam_profile: true) }
|
100
139
|
end
|
101
140
|
|
141
|
+
ENV["AWS_STS_REGIONAL_ENDPOINTS"] = nil
|
142
|
+
ENV["AWS_DEFAULT_REGION"] = nil
|
102
143
|
ENV['AWS_WEB_IDENTITY_TOKEN_FILE'] = nil
|
103
144
|
|
104
145
|
compute = Fog::AWS::Compute.new(use_iam_profile: true)
|
@@ -1,4 +1,117 @@
|
|
1
1
|
Shindo.tests("Storage[:aws] | directory", ["aws"]) do
|
2
|
+
tests('Fog::Storage[:aws]', "#request_params") do
|
3
|
+
def slice(hash, *args)
|
4
|
+
hash.select { |k, _| args.include?(k) }
|
5
|
+
end
|
6
|
+
|
7
|
+
instance = Fog::Storage[:aws]
|
8
|
+
method = instance.method(:request_params)
|
9
|
+
|
10
|
+
params = {bucket_name: 'profile-uploads', host: 'profile-uploads.s3.us-west-2.amazonaws.com'}
|
11
|
+
tests("given #{params}, request_params[:host]").returns("profile-uploads.s3.us-west-2.amazonaws.com") do
|
12
|
+
method.call(params)[:host]
|
13
|
+
end
|
14
|
+
|
15
|
+
params = {bucket_name: 'profile-uploads.johnsmith.net', cname: 'profile-uploads.johnsmith.net', virtual_host: true}
|
16
|
+
tests("given #{params}, request_params[:host]").returns("profile-uploads.johnsmith.net") do
|
17
|
+
method.call(params)[:host]
|
18
|
+
end
|
19
|
+
|
20
|
+
params = {bucket_name: 'profile-uploads.johnsmith.net', cname: 'profile-uploads.johnsmith.net', virtual_host: false}
|
21
|
+
tests("given #{params}, request_params[:host], request_params[:path]").
|
22
|
+
returns({host: "s3.amazonaws.com", path: "/profile-uploads.johnsmith.net/"}) do
|
23
|
+
slice(method.call(params), :host, :path)
|
24
|
+
end
|
25
|
+
|
26
|
+
params = {bucket_name: 'profile-uploads.johnsmith.net', bucket_cname: 'profile-uploads.johnsmith.net'}
|
27
|
+
tests("given #{params}, request_params[:host]").returns("profile-uploads.johnsmith.net") do
|
28
|
+
method.call(params)[:host]
|
29
|
+
end
|
30
|
+
|
31
|
+
params = {bucket_name: 'profile-uploads'}
|
32
|
+
tests("given #{params}, request_params[:path], request_params[:host]").
|
33
|
+
returns({path: "/", host: "profile-uploads.s3.amazonaws.com"}) do
|
34
|
+
slice(method.call(params), :path, :host)
|
35
|
+
end
|
36
|
+
|
37
|
+
params = {bucket_name: 'profile-uploads', path_style: true}
|
38
|
+
tests("given #{params}, request_params[:path], request_params[:host]").
|
39
|
+
returns({path: "/profile-uploads/", host: "s3.amazonaws.com"}) do
|
40
|
+
slice(method.call(params), :path, :host)
|
41
|
+
end
|
42
|
+
|
43
|
+
params = {bucket_name: 'profile-uploads', path_style: false}
|
44
|
+
tests("given #{params}, request_params[:path], request_params[:host]").
|
45
|
+
returns({path: "/", host: "profile-uploads.s3.amazonaws.com"}) do
|
46
|
+
slice(method.call(params), :path, :host)
|
47
|
+
end
|
48
|
+
|
49
|
+
params = {scheme: 'https', bucket_name: 'profile.uploads', path_style: false}
|
50
|
+
tests("given #{params}, request_params[:path], request_params[:host]").
|
51
|
+
returns(path: "/profile.uploads/", host: "s3.amazonaws.com") do
|
52
|
+
slice(method.call(params), :path, :host)
|
53
|
+
end
|
54
|
+
|
55
|
+
params = {:headers=>{:"Content-Type"=>"application/json"}}
|
56
|
+
tests("given #{params}, request_params[:headers]").returns({:"Content-Type"=>"application/json"}) do
|
57
|
+
method.call(params)[:headers]
|
58
|
+
end
|
59
|
+
|
60
|
+
params = {headers: {}}
|
61
|
+
tests("given #{params}, request_params[:headers]").returns({}) do
|
62
|
+
method.call(params)[:headers]
|
63
|
+
end
|
64
|
+
|
65
|
+
params = {scheme: 'http'}
|
66
|
+
tests("given #{params}, request_params[:scheme]").returns('http') do
|
67
|
+
method.call(params)[:scheme]
|
68
|
+
end
|
69
|
+
|
70
|
+
params = {}
|
71
|
+
tests("given #{params}, request_params[:scheme]").returns('https') do
|
72
|
+
method.call(params)[:scheme]
|
73
|
+
end
|
74
|
+
|
75
|
+
params = {scheme: 'http', port: 8080}
|
76
|
+
tests("given #{params} (default scheme), request_params[:port]").returns(8080) do
|
77
|
+
method.call(params)[:port]
|
78
|
+
end
|
79
|
+
|
80
|
+
params = {scheme: 'https', port: 443}
|
81
|
+
tests("given #{params}, request_params[:port]").returns(nil) do
|
82
|
+
method.call(params)[:port]
|
83
|
+
end
|
84
|
+
|
85
|
+
params = {}
|
86
|
+
tests("given #{params}, request_params[:host]").returns("s3.amazonaws.com") do
|
87
|
+
method.call(params)[:host]
|
88
|
+
end
|
89
|
+
|
90
|
+
params = {region: 'us-east-1'}
|
91
|
+
tests("given #{params}, request_params[:host]").returns("s3.amazonaws.com") do
|
92
|
+
method.call(params)[:host]
|
93
|
+
end
|
94
|
+
|
95
|
+
params = {region: 'us-west-2'}
|
96
|
+
tests("given #{params}, request_params[:host]").returns("s3.us-west-2.amazonaws.com") do
|
97
|
+
method.call(params)[:host]
|
98
|
+
end
|
99
|
+
|
100
|
+
params= {region: 'us-east-1', host: 's3.us-west-2.amazonaws.com'}
|
101
|
+
tests("given #{params}, request_params[:host]").returns("s3.us-west-2.amazonaws.com") do
|
102
|
+
method.call(params)[:host]
|
103
|
+
end
|
104
|
+
|
105
|
+
params = {object_name: 'image.png'}
|
106
|
+
tests("given #{params}, request_params[:host]").returns("/image.png") do
|
107
|
+
method.call(params)[:path]
|
108
|
+
end
|
109
|
+
|
110
|
+
params = {object_name: 'image.png', path: '/images/image.png'}
|
111
|
+
tests("given #{params}, request_params[:host]").returns("/images/image.png") do
|
112
|
+
method.call(params)[:path]
|
113
|
+
end
|
114
|
+
end
|
2
115
|
|
3
116
|
directory_attributes = {
|
4
117
|
:key => uniq_id('fogdirectorytests')
|
@@ -85,7 +198,5 @@ Shindo.tests("Storage[:aws] | directory", ["aws"]) do
|
|
85
198
|
@instance.versioning?
|
86
199
|
end
|
87
200
|
end
|
88
|
-
|
89
201
|
end
|
90
|
-
|
91
202
|
end
|
@@ -19,6 +19,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
19
19
|
'groups' => [{ 'groupName' => Fog::Nullable::String, 'userId' => String, 'groupId' => String }],
|
20
20
|
'ipProtocol' => String,
|
21
21
|
'ipRanges' => [Fog::Nullable::Hash],
|
22
|
+
'ipv6Ranges' => [Fog::Nullable::Hash],
|
22
23
|
'toPort' => Fog::Nullable::Integer,
|
23
24
|
}],
|
24
25
|
'ipPermissionsEgress' => [],
|
@@ -54,16 +55,19 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
54
55
|
{"groups"=>[{"groupName"=>"default", "userId"=>@owner_id, "groupId"=>@group_id_default}],
|
55
56
|
"fromPort"=>1,
|
56
57
|
"ipRanges"=>[],
|
58
|
+
"ipv6Ranges"=>[],
|
57
59
|
"ipProtocol"=>"tcp",
|
58
60
|
"toPort"=>65535},
|
59
61
|
{"groups"=>[{"groupName"=>"default", "userId"=>@owner_id, "groupId"=>@group_id_default}],
|
60
62
|
"fromPort"=>1,
|
61
63
|
"ipRanges"=>[],
|
64
|
+
"ipv6Ranges"=>[],
|
62
65
|
"ipProtocol"=>"udp",
|
63
66
|
"toPort"=>65535},
|
64
67
|
{"groups"=>[{"groupName"=>"default", "userId"=>@owner_id, "groupId"=>@group_id_default}],
|
65
68
|
"fromPort"=>-1,
|
66
69
|
"ipRanges"=>[],
|
70
|
+
"ipv6Ranges"=>[],
|
67
71
|
"ipProtocol"=>"icmp",
|
68
72
|
"toPort"=>-1}
|
69
73
|
]
|
@@ -88,6 +92,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
88
92
|
[{"userId"=>@owner_id, "groupName"=>"default", "groupId"=>@group_id_default},
|
89
93
|
{"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
|
90
94
|
"ipRanges"=>[],
|
95
|
+
"ipv6Ranges"=>[],
|
91
96
|
"ipProtocol"=>"tcp",
|
92
97
|
"fromPort"=>1,
|
93
98
|
"toPort"=>65535},
|
@@ -95,6 +100,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
95
100
|
[{"userId"=>@owner_id, "groupName"=>"default", "groupId"=>@group_id_default},
|
96
101
|
{"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
|
97
102
|
"ipRanges"=>[],
|
103
|
+
"ipv6Ranges"=>[],
|
98
104
|
"ipProtocol"=>"udp",
|
99
105
|
"fromPort"=>1,
|
100
106
|
"toPort"=>65535},
|
@@ -102,6 +108,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
102
108
|
[{"userId"=>@owner_id, "groupName"=>"default", "groupId"=>@group_id_default},
|
103
109
|
{"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
|
104
110
|
"ipRanges"=>[],
|
111
|
+
"ipv6Ranges"=>[],
|
105
112
|
"ipProtocol"=>"icmp",
|
106
113
|
"fromPort"=>-1,
|
107
114
|
"toPort"=>-1}
|
@@ -133,6 +140,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
133
140
|
expected_permissions += [
|
134
141
|
{"groups"=>[],
|
135
142
|
"ipRanges"=>[{"cidrIp"=>"10.0.0.0/8"}],
|
143
|
+
"ipv6Ranges"=>[],
|
136
144
|
"ipProtocol"=>"tcp",
|
137
145
|
"fromPort"=>22,
|
138
146
|
"toPort"=>22}
|
@@ -164,7 +172,8 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
164
172
|
'IpPermissions' => [
|
165
173
|
{
|
166
174
|
'IpProtocol' => 'tcp', 'FromPort' => '80', 'ToPort' => '80',
|
167
|
-
'IpRanges' => [{ 'CidrIp' => '192.168.0.0/24' }]
|
175
|
+
'IpRanges' => [{ 'CidrIp' => '192.168.0.0/24' }],
|
176
|
+
'Ipv6Ranges' => []
|
168
177
|
}
|
169
178
|
]
|
170
179
|
}
|
@@ -177,6 +186,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
177
186
|
expected_permissions += [
|
178
187
|
{"groups"=>[],
|
179
188
|
"ipRanges"=>[{"cidrIp"=>"192.168.0.0/24"}],
|
189
|
+
"ipv6Ranges"=>[],
|
180
190
|
"ipProtocol"=>"tcp",
|
181
191
|
"fromPort"=>80,
|
182
192
|
"toPort"=>80}
|
@@ -204,6 +214,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
|
|
204
214
|
expected_permissions += [
|
205
215
|
{"groups"=>[{"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
|
206
216
|
"ipRanges"=>[],
|
217
|
+
"ipv6Ranges"=>[],
|
207
218
|
"ipProtocol"=>"tcp",
|
208
219
|
"fromPort"=>8000,
|
209
220
|
"toPort"=>8000}
|
@@ -158,7 +158,7 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', ["aws"]) do
|
|
158
158
|
Fog::Storage[:aws].put_bucket_website(@aws_bucket_name, :IndexDocument => 'index.html')
|
159
159
|
end
|
160
160
|
|
161
|
-
tests("#put_bucket_website('#{@aws_bucket_name}', :RedirectAllRequestsTo => 'redirect.example
|
161
|
+
tests("#put_bucket_website('#{@aws_bucket_name}', :RedirectAllRequestsTo => 'redirect.example.com')").succeeds do
|
162
162
|
Fog::Storage[:aws].put_bucket_website(@aws_bucket_name, :RedirectAllRequestsTo => 'redirect.example.com')
|
163
163
|
end
|
164
164
|
|
@@ -134,6 +134,44 @@ Shindo.tests('Fog::Storage[:aws] | versioning', ["aws"]) do
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
+
tests("deleting_multiple_objects_versions('#{@aws_bucket_name}", 'file') do
|
138
|
+
clear_bucket
|
139
|
+
|
140
|
+
bucket = Fog::Storage[:aws].directories.get(@aws_bucket_name)
|
141
|
+
|
142
|
+
file_count = 5
|
143
|
+
file_names = []
|
144
|
+
files = {}
|
145
|
+
file_count.times do |id|
|
146
|
+
file_names << "file_#{id}"
|
147
|
+
file_version_count = rand(1..5)
|
148
|
+
file_version_count.times do
|
149
|
+
files[file_names.last] = bucket.files.create(:body => 'a',
|
150
|
+
:key => file_names.last)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
tests("deleting an object with multiple versions").returns(true) do
|
155
|
+
versions = Fog::Storage[:aws].get_bucket_object_versions(
|
156
|
+
@aws_bucket_name)
|
157
|
+
file_versions = {}
|
158
|
+
versions.body['Versions'].each do |version|
|
159
|
+
object = version[version.keys.first]
|
160
|
+
if file_versions[object['Key']]
|
161
|
+
file_versions[object['Key']] = file_versions[object['Key']] << object['VersionId']
|
162
|
+
else
|
163
|
+
file_versions[object['Key']] = [object['VersionId']]
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
Fog::Storage[:aws].delete_multiple_objects(@aws_bucket_name,
|
168
|
+
file_names, 'versionId' => file_versions)
|
169
|
+
versions = Fog::Storage[:aws].get_bucket_object_versions(
|
170
|
+
@aws_bucket_name)
|
171
|
+
versions.body['Versions'].empty?
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
137
175
|
tests("deleting_multiple_objects('#{@aws_bucket_name}", 'file') do
|
138
176
|
clear_bucket
|
139
177
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
@@ -9,36 +9,36 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-08-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: github_changelog_generator
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1.
|
34
|
+
version: '1.16'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1.
|
41
|
+
version: '1.16'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 2.3.0
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 2.3.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: shindo
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,20 +147,12 @@ executables: []
|
|
147
147
|
extensions: []
|
148
148
|
extra_rdoc_files: []
|
149
149
|
files:
|
150
|
-
- ".gitignore"
|
151
|
-
- ".travis.yml"
|
152
150
|
- CHANGELOG.md
|
153
151
|
- CONTRIBUTING.md
|
154
152
|
- CONTRIBUTORS.md
|
155
|
-
- Gemfile
|
156
153
|
- LICENSE.md
|
157
154
|
- README.md
|
158
|
-
- Rakefile
|
159
|
-
- bin/console
|
160
|
-
- bin/setup
|
161
155
|
- fog-aws.gemspec
|
162
|
-
- gemfiles/Gemfile-edge
|
163
|
-
- gemfiles/Gemfile-ruby-2.0
|
164
156
|
- lib/fog-aws.rb
|
165
157
|
- lib/fog/aws.rb
|
166
158
|
- lib/fog/aws/auto_scaling.rb
|
@@ -184,9 +176,7 @@ files:
|
|
184
176
|
- lib/fog/aws/federation.rb
|
185
177
|
- lib/fog/aws/glacier.rb
|
186
178
|
- lib/fog/aws/iam.rb
|
187
|
-
- lib/fog/aws/iam/default_policies.json
|
188
179
|
- lib/fog/aws/iam/default_policies.rb
|
189
|
-
- lib/fog/aws/iam/default_policy_versions.json
|
190
180
|
- lib/fog/aws/iam/paged_collection.rb
|
191
181
|
- lib/fog/aws/kinesis.rb
|
192
182
|
- lib/fog/aws/kms.rb
|
@@ -1461,7 +1451,6 @@ files:
|
|
1461
1451
|
- lib/fog/aws/sts.rb
|
1462
1452
|
- lib/fog/aws/support.rb
|
1463
1453
|
- lib/fog/aws/version.rb
|
1464
|
-
- stale.yml
|
1465
1454
|
- tests/credentials_tests.rb
|
1466
1455
|
- tests/helper.rb
|
1467
1456
|
- tests/helpers/collection_helper.rb
|
@@ -1744,7 +1733,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1744
1733
|
- !ruby/object:Gem::Version
|
1745
1734
|
version: '0'
|
1746
1735
|
requirements: []
|
1747
|
-
rubygems_version: 3.
|
1736
|
+
rubygems_version: 3.2.15
|
1748
1737
|
signing_key:
|
1749
1738
|
specification_version: 4
|
1750
1739
|
summary: Module for the 'fog' gem to support Amazon Web Services.
|