aws-sdk-s3 1.105.1 → 1.106.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/client.rb +1 -1
- data/lib/aws-sdk-s3/customizations/object.rb +74 -1
- data/lib/aws-sdk-s3.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: b88adac8854f4eeb8210735da5ea5087e651c640f9a92e25ed6c4f96ad6ef459
|
4
|
+
data.tar.gz: 64ebe11f97661fb709c52724b4ef3aced1e6fc9b1341c4afd2e00d668b888dea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 776794c0a09c05871bf4bd3ccc6370cb46b9cbace5213acf09e4598509460bb585b8a55263fdc37191b82bba3eb4707b092ef82258e2a59313e527f22a1860f7
|
7
|
+
data.tar.gz: 53a6b5652862a2f053ca06733c7eccd0ea83144ee5f92776eaa6ea4a9002ab3f69b392d7f98ffc3f1991846d3799cf0f099157d5d0fe4fa71a7e444aaa696511
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.106.0
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -14066,7 +14066,7 @@ module Aws::S3
|
|
14066
14066
|
params: params,
|
14067
14067
|
config: config)
|
14068
14068
|
context[:gem_name] = 'aws-sdk-s3'
|
14069
|
-
context[:gem_version] = '1.
|
14069
|
+
context[:gem_version] = '1.106.0'
|
14070
14070
|
Seahorse::Client::Request.new(handlers, context)
|
14071
14071
|
end
|
14072
14072
|
|
@@ -161,7 +161,7 @@ module Aws
|
|
161
161
|
#
|
162
162
|
# @param [Symbol] method
|
163
163
|
# The S3 operation to generate a presigned URL for. Valid values
|
164
|
-
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
164
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
165
165
|
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
166
166
|
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
167
167
|
#
|
@@ -215,6 +215,79 @@ module Aws
|
|
215
215
|
)
|
216
216
|
end
|
217
217
|
|
218
|
+
# Allows you to create presigned URL requests for S3 operations. This
|
219
|
+
# method returns a tuple containing the URL and the signed X-amz-* headers
|
220
|
+
# to be used with the presigned url.
|
221
|
+
#
|
222
|
+
# @example Pre-signed GET URL, valid for one hour
|
223
|
+
#
|
224
|
+
# obj.presigned_request(:get, expires_in: 3600)
|
225
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...", {}]
|
226
|
+
#
|
227
|
+
# @example Pre-signed PUT with a canned ACL
|
228
|
+
#
|
229
|
+
# # the object uploaded using this URL will be publicly accessible
|
230
|
+
# obj.presigned_request(:put, acl: 'public-read')
|
231
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...",
|
232
|
+
# {"x-amz-acl"=>"public-read"}]
|
233
|
+
#
|
234
|
+
# @param [Symbol] method
|
235
|
+
# The S3 operation to generate a presigned request for. Valid values
|
236
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
237
|
+
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
238
|
+
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
239
|
+
#
|
240
|
+
# @param [Hash] params
|
241
|
+
# Additional request parameters to use when generating the pre-signed
|
242
|
+
# request. See the related documentation in {Client} for accepted
|
243
|
+
# params.
|
244
|
+
#
|
245
|
+
# | Method | Client Method |
|
246
|
+
# |------------------------------|------------------------------------|
|
247
|
+
# | `:get` | {Client#get_object} |
|
248
|
+
# | `:put` | {Client#put_object} |
|
249
|
+
# | `:head` | {Client#head_object} |
|
250
|
+
# | `:delete` | {Client#delete_object} |
|
251
|
+
# | `:create_multipart_upload` | {Client#create_multipart_upload} |
|
252
|
+
# | `:list_multipart_uploads` | {Client#list_multipart_uploads} |
|
253
|
+
# | `:complete_multipart_upload` | {Client#complete_multipart_upload} |
|
254
|
+
# | `:abort_multipart_upload` | {Client#abort_multipart_upload} |
|
255
|
+
# | `:list_parts` | {Client#list_parts} |
|
256
|
+
# | `:upload_part` | {Client#upload_part} |
|
257
|
+
#
|
258
|
+
# @option params [Boolean] :virtual_host (false) When `true` the
|
259
|
+
# presigned URL will use the bucket name as a virtual host.
|
260
|
+
#
|
261
|
+
# bucket = Aws::S3::Bucket.new('my.bucket.com')
|
262
|
+
# bucket.object('key').presigned_request(virtual_host: true)
|
263
|
+
# #=> ["http://my.bucket.com/key?...", {}]
|
264
|
+
#
|
265
|
+
# @option params [Integer] :expires_in (900) Number of seconds before
|
266
|
+
# the pre-signed URL expires. This may not exceed one week (604800
|
267
|
+
# seconds). Note that the pre-signed URL is also only valid as long as
|
268
|
+
# credentials used to sign it are. For example, when using IAM roles,
|
269
|
+
# temporary tokens generated for signing also have a default expiration
|
270
|
+
# which will affect the effective expiration of the pre-signed URL.
|
271
|
+
#
|
272
|
+
# @raise [ArgumentError] Raised if `:expires_in` exceeds one week
|
273
|
+
# (604800 seconds).
|
274
|
+
#
|
275
|
+
# @return [String, Hash] A tuple with a presigned URL and headers that
|
276
|
+
# should be included with the request.
|
277
|
+
#
|
278
|
+
def presigned_request(method, params = {})
|
279
|
+
presigner = Presigner.new(client: client)
|
280
|
+
|
281
|
+
if %w(delete head get put).include?(method.to_s)
|
282
|
+
method = "#{method}_object".to_sym
|
283
|
+
end
|
284
|
+
|
285
|
+
presigner.presigned_request(
|
286
|
+
method.downcase,
|
287
|
+
params.merge(bucket: bucket_name, key: key)
|
288
|
+
)
|
289
|
+
end
|
290
|
+
|
218
291
|
# Returns the public (un-signed) URL for this object.
|
219
292
|
#
|
220
293
|
# s3.bucket('bucket-name').object('obj-key').public_url
|
data/lib/aws-sdk-s3.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.106.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: 2021-11-
|
11
|
+
date: 2021-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|