aws-sdk-s3 1.68.1 → 1.83.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-s3.rb +5 -2
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +62 -0
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +71 -0
- data/lib/aws-sdk-s3/bucket.rb +58 -7
- data/lib/aws-sdk-s3/bucket_acl.rb +7 -0
- data/lib/aws-sdk-s3/bucket_cors.rb +14 -1
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +14 -1
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +14 -1
- data/lib/aws-sdk-s3/bucket_logging.rb +7 -0
- data/lib/aws-sdk-s3/bucket_notification.rb +7 -0
- data/lib/aws-sdk-s3/bucket_policy.rb +14 -1
- data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
- data/lib/aws-sdk-s3/bucket_request_payment.rb +7 -0
- data/lib/aws-sdk-s3/bucket_tagging.rb +14 -1
- data/lib/aws-sdk-s3/bucket_versioning.rb +17 -0
- data/lib/aws-sdk-s3/bucket_website.rb +14 -1
- data/lib/aws-sdk-s3/client.rb +2133 -678
- data/lib/aws-sdk-s3/client_api.rb +150 -0
- data/lib/aws-sdk-s3/customizations.rb +3 -0
- data/lib/aws-sdk-s3/customizations/bucket.rb +9 -4
- data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
- data/lib/aws-sdk-s3/customizations/object.rb +14 -1
- data/lib/aws-sdk-s3/customizations/object_summary.rb +2 -0
- data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
- data/lib/aws-sdk-s3/encryption.rb +4 -0
- data/lib/aws-sdk-s3/encryption/client.rb +13 -0
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +72 -26
- data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
- data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
- data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
- data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +34 -3
- data/lib/aws-sdk-s3/encryption/materials.rb +2 -0
- data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
- data/lib/aws-sdk-s3/encryptionV2/client.rb +566 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +226 -0
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
- data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +69 -0
- data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
- data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
- data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +169 -0
- data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
- data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
- data/lib/aws-sdk-s3/errors.rb +2 -0
- data/lib/aws-sdk-s3/event_streams.rb +2 -0
- data/lib/aws-sdk-s3/file_downloader.rb +2 -0
- data/lib/aws-sdk-s3/file_part.rb +2 -0
- data/lib/aws-sdk-s3/file_uploader.rb +13 -0
- data/lib/aws-sdk-s3/legacy_signer.rb +2 -0
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +39 -2
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload.rb +17 -0
- data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +66 -7
- data/lib/aws-sdk-s3/object.rb +160 -19
- data/lib/aws-sdk-s3/object_acl.rb +15 -0
- data/lib/aws-sdk-s3/object_copier.rb +2 -0
- data/lib/aws-sdk-s3/object_multipart_copier.rb +2 -0
- data/lib/aws-sdk-s3/object_summary.rb +173 -17
- data/lib/aws-sdk-s3/object_version.rb +29 -3
- data/lib/aws-sdk-s3/plugins/accelerate.rb +29 -38
- data/lib/aws-sdk-s3/plugins/arn.rb +187 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +2 -2
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +3 -1
- data/lib/aws-sdk-s3/plugins/dualstack.rb +5 -1
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +2 -0
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +2 -0
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +4 -1
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +2 -0
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +2 -0
- data/lib/aws-sdk-s3/plugins/md5s.rb +2 -0
- data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +31 -7
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +118 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
- data/lib/aws-sdk-s3/presigned_post.rb +64 -28
- data/lib/aws-sdk-s3/presigner.rb +5 -2
- data/lib/aws-sdk-s3/resource.rb +3 -1
- data/lib/aws-sdk-s3/types.rb +1881 -222
- data/lib/aws-sdk-s3/waiters.rb +2 -0
- metadata +22 -5
- data/lib/aws-sdk-s3/plugins/bucket_arn.rb +0 -210
data/lib/aws-sdk-s3/waiters.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.83.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '3'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 3.
|
50
|
+
version: 3.109.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '3'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 3.
|
60
|
+
version: 3.109.0
|
61
61
|
description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
|
62
62
|
This gem is part of the AWS SDK for Ruby.
|
63
63
|
email:
|
@@ -67,6 +67,8 @@ extensions: []
|
|
67
67
|
extra_rdoc_files: []
|
68
68
|
files:
|
69
69
|
- lib/aws-sdk-s3.rb
|
70
|
+
- lib/aws-sdk-s3/arn/access_point_arn.rb
|
71
|
+
- lib/aws-sdk-s3/arn/outpost_access_point_arn.rb
|
70
72
|
- lib/aws-sdk-s3/bucket.rb
|
71
73
|
- lib/aws-sdk-s3/bucket_acl.rb
|
72
74
|
- lib/aws-sdk-s3/bucket_cors.rb
|
@@ -102,6 +104,20 @@ files:
|
|
102
104
|
- lib/aws-sdk-s3/encryption/kms_cipher_provider.rb
|
103
105
|
- lib/aws-sdk-s3/encryption/materials.rb
|
104
106
|
- lib/aws-sdk-s3/encryption/utils.rb
|
107
|
+
- lib/aws-sdk-s3/encryptionV2/client.rb
|
108
|
+
- lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb
|
109
|
+
- lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb
|
110
|
+
- lib/aws-sdk-s3/encryptionV2/default_key_provider.rb
|
111
|
+
- lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb
|
112
|
+
- lib/aws-sdk-s3/encryptionV2/errors.rb
|
113
|
+
- lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb
|
114
|
+
- lib/aws-sdk-s3/encryptionV2/io_decrypter.rb
|
115
|
+
- lib/aws-sdk-s3/encryptionV2/io_encrypter.rb
|
116
|
+
- lib/aws-sdk-s3/encryptionV2/key_provider.rb
|
117
|
+
- lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb
|
118
|
+
- lib/aws-sdk-s3/encryptionV2/materials.rb
|
119
|
+
- lib/aws-sdk-s3/encryptionV2/utils.rb
|
120
|
+
- lib/aws-sdk-s3/encryption_v2.rb
|
105
121
|
- lib/aws-sdk-s3/errors.rb
|
106
122
|
- lib/aws-sdk-s3/event_streams.rb
|
107
123
|
- lib/aws-sdk-s3/file_downloader.rb
|
@@ -120,7 +136,7 @@ files:
|
|
120
136
|
- lib/aws-sdk-s3/object_summary.rb
|
121
137
|
- lib/aws-sdk-s3/object_version.rb
|
122
138
|
- lib/aws-sdk-s3/plugins/accelerate.rb
|
123
|
-
- lib/aws-sdk-s3/plugins/
|
139
|
+
- lib/aws-sdk-s3/plugins/arn.rb
|
124
140
|
- lib/aws-sdk-s3/plugins/bucket_dns.rb
|
125
141
|
- lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb
|
126
142
|
- lib/aws-sdk-s3/plugins/dualstack.rb
|
@@ -134,6 +150,7 @@ files:
|
|
134
150
|
- lib/aws-sdk-s3/plugins/s3_host_id.rb
|
135
151
|
- lib/aws-sdk-s3/plugins/s3_signer.rb
|
136
152
|
- lib/aws-sdk-s3/plugins/sse_cpk.rb
|
153
|
+
- lib/aws-sdk-s3/plugins/streaming_retry.rb
|
137
154
|
- lib/aws-sdk-s3/plugins/url_encoded_keys.rb
|
138
155
|
- lib/aws-sdk-s3/presigned_post.rb
|
139
156
|
- lib/aws-sdk-s3/presigner.rb
|
@@ -1,210 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module S3
|
3
|
-
module Plugins
|
4
|
-
# When an accesspoint ARN is provided for :bucket in S3 operations, this
|
5
|
-
# plugin resolves the request endpoint from the ARN when possible.
|
6
|
-
class BucketARN < Seahorse::Client::Plugin
|
7
|
-
option(
|
8
|
-
:s3_use_arn_region,
|
9
|
-
default: true,
|
10
|
-
doc_type: 'Boolean',
|
11
|
-
docstring: <<-DOCS) do |cfg|
|
12
|
-
By default, the SDK will use the S3 ARN region, and cross-region
|
13
|
-
requests could be made. Set to `false` to not use the region from
|
14
|
-
the S3 ARN.
|
15
|
-
DOCS
|
16
|
-
resolve_s3_use_arn_region(cfg)
|
17
|
-
end
|
18
|
-
|
19
|
-
def add_handlers(handlers, _config)
|
20
|
-
handlers.add(Handler)
|
21
|
-
end
|
22
|
-
|
23
|
-
# @api private
|
24
|
-
class Handler < Seahorse::Client::Handler
|
25
|
-
def call(context)
|
26
|
-
bucket_member = _bucket_member(context.operation.input.shape)
|
27
|
-
if bucket_member && (bucket = context.params[bucket_member])
|
28
|
-
_resolved_bucket, _resolved_region, arn = BucketARN.resolve_arn!(
|
29
|
-
bucket,
|
30
|
-
context.config.region,
|
31
|
-
context.config.s3_use_arn_region
|
32
|
-
)
|
33
|
-
if arn
|
34
|
-
if arn.resource.start_with?('accesspoint')
|
35
|
-
validate_config!(context.config)
|
36
|
-
end
|
37
|
-
|
38
|
-
dualstack = extract_dualstack_config!(context)
|
39
|
-
|
40
|
-
BucketARN.resolve_url!(
|
41
|
-
context.http_request.endpoint,
|
42
|
-
arn,
|
43
|
-
dualstack
|
44
|
-
)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
@handler.call(context)
|
48
|
-
end
|
49
|
-
|
50
|
-
private
|
51
|
-
|
52
|
-
def _bucket_member(input)
|
53
|
-
input.members.each do |member, ref|
|
54
|
-
return member if ref.shape.name == 'BucketName'
|
55
|
-
end
|
56
|
-
nil
|
57
|
-
end
|
58
|
-
|
59
|
-
# other plugins use dualstack so disable it when we're done
|
60
|
-
def extract_dualstack_config!(context)
|
61
|
-
dualstack = context[:use_dualstack_endpoint]
|
62
|
-
context[:use_dualstack_endpoint] = false if dualstack
|
63
|
-
dualstack
|
64
|
-
end
|
65
|
-
|
66
|
-
def validate_config!(config)
|
67
|
-
unless config.regional_endpoint
|
68
|
-
raise ArgumentError,
|
69
|
-
'Cannot provide both an accesspoint ARN and :endpoint.'
|
70
|
-
end
|
71
|
-
|
72
|
-
if config.use_accelerate_endpoint
|
73
|
-
raise ArgumentError,
|
74
|
-
'Cannot provide both an accesspoint ARN and setting '\
|
75
|
-
':use_accelerate_endpoint to true.'
|
76
|
-
end
|
77
|
-
|
78
|
-
if config.force_path_style
|
79
|
-
raise ArgumentError,
|
80
|
-
'Cannot provide both an accesspoint ARN and setting '\
|
81
|
-
':force_path_style to true.'
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
class << self
|
87
|
-
|
88
|
-
# @api private
|
89
|
-
def resolve_arn!(bucket_name, region, s3_use_arn_region)
|
90
|
-
if Aws::ARNParser.arn?(bucket_name)
|
91
|
-
arn = Aws::ARNParser.parse(bucket_name)
|
92
|
-
validate_s3_arn!(arn)
|
93
|
-
validate_region!(arn, region, s3_use_arn_region)
|
94
|
-
if arn.resource.start_with?('accesspoint')
|
95
|
-
region = arn.region if s3_use_arn_region
|
96
|
-
[bucket_name, region, arn]
|
97
|
-
else
|
98
|
-
raise ArgumentError,
|
99
|
-
'Only accesspoint type ARNs are currently supported.'
|
100
|
-
end
|
101
|
-
else
|
102
|
-
[bucket_name, region]
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
# @api private
|
107
|
-
def resolve_url!(url, arn, dualstack = false)
|
108
|
-
if arn.resource.start_with?('accesspoint')
|
109
|
-
url.host = accesspoint_arn_host(arn, dualstack)
|
110
|
-
else
|
111
|
-
raise ArgumentError,
|
112
|
-
'Only accesspoint type ARNs are currently supported.'
|
113
|
-
end
|
114
|
-
url.path = url_path(url.path, arn)
|
115
|
-
url
|
116
|
-
end
|
117
|
-
|
118
|
-
private
|
119
|
-
|
120
|
-
def accesspoint_arn_host(arn, dualstack)
|
121
|
-
_resource_type, resource_name = parse_resource(arn.resource)
|
122
|
-
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(arn.region)
|
123
|
-
"#{resource_name}-#{arn.account_id}"\
|
124
|
-
'.s3-accesspoint'\
|
125
|
-
"#{'.dualstack' if dualstack}"\
|
126
|
-
".#{arn.region}.#{sfx}"
|
127
|
-
end
|
128
|
-
|
129
|
-
def parse_resource(str)
|
130
|
-
slash = str.index('/') || str.length
|
131
|
-
colon = str.index(':') || str.length
|
132
|
-
delimiter = slash < colon ? slash : colon
|
133
|
-
if delimiter < str.length
|
134
|
-
[str[0..(delimiter - 1)], str[(delimiter + 1)..-1]]
|
135
|
-
else
|
136
|
-
[nil, str]
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
def resolve_s3_use_arn_region(cfg)
|
141
|
-
value = ENV['AWS_S3_USE_ARN_REGION'] ||
|
142
|
-
Aws.shared_config.s3_use_arn_region(profile: cfg.profile) ||
|
143
|
-
'true'
|
144
|
-
|
145
|
-
# Raise if provided value is not true or false
|
146
|
-
if value != 'true' && value != 'false'
|
147
|
-
raise ArgumentError,
|
148
|
-
'Must provide either `true` or `false` for '\
|
149
|
-
's3_use_arn_region profile option or for '\
|
150
|
-
'ENV[\'AWS_S3_USE_ARN_REGION\']'
|
151
|
-
end
|
152
|
-
|
153
|
-
value == 'true'
|
154
|
-
end
|
155
|
-
|
156
|
-
def url_path(path, arn)
|
157
|
-
path = path.sub("/#{Seahorse::Util.uri_escape(arn.to_s)}", '')
|
158
|
-
.sub("/#{arn}", '')
|
159
|
-
"/#{path}" unless path.match(/^\//)
|
160
|
-
path
|
161
|
-
end
|
162
|
-
|
163
|
-
def validate_s3_arn!(arn)
|
164
|
-
_resource_type, resource_name = parse_resource(arn.resource)
|
165
|
-
|
166
|
-
unless arn.service == 's3'
|
167
|
-
raise ArgumentError, 'Must provide an S3 ARN.'
|
168
|
-
end
|
169
|
-
|
170
|
-
if arn.region.empty? || arn.account_id.empty?
|
171
|
-
raise ArgumentError,
|
172
|
-
'S3 Access Point ARNs must contain both a valid region '\
|
173
|
-
' and a valid account id.'
|
174
|
-
end
|
175
|
-
|
176
|
-
if resource_name.include?(':') || resource_name.include?('/')
|
177
|
-
raise ArgumentError,
|
178
|
-
'ARN resource id must be a single value.'
|
179
|
-
end
|
180
|
-
|
181
|
-
unless Plugins::BucketDns.valid_subdomain?(
|
182
|
-
"#{resource_name}-#{arn.account_id}"
|
183
|
-
)
|
184
|
-
raise ArgumentError,
|
185
|
-
"#{resource_name}-#{arn.account_id} is not a "\
|
186
|
-
'valid subdomain.'
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
def validate_region!(arn, region, s3_use_arn_region)
|
191
|
-
if region.include?('fips')
|
192
|
-
raise ArgumentError,
|
193
|
-
'FIPS client regions are currently not supported with '\
|
194
|
-
'accesspoint ARNs.'
|
195
|
-
end
|
196
|
-
|
197
|
-
if s3_use_arn_region &&
|
198
|
-
!Aws::Partitions.partition(arn.partition).region?(region)
|
199
|
-
raise Aws::Errors::InvalidARNPartitionError
|
200
|
-
end
|
201
|
-
|
202
|
-
if !s3_use_arn_region && region != arn.region
|
203
|
-
raise Aws::Errors::InvalidARNRegionError
|
204
|
-
end
|
205
|
-
end
|
206
|
-
end
|
207
|
-
end
|
208
|
-
end
|
209
|
-
end
|
210
|
-
end
|