aws-sdk-s3 1.105.1 → 1.106.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24f59e973ff598dd26d05f76e33a018f25996a1c2d1861212ed76df16bbebf88
4
- data.tar.gz: b8cfed10b315b31359357ddf6f8553a1e3c8192923a2049cbba6e118e407c308
3
+ metadata.gz: b88adac8854f4eeb8210735da5ea5087e651c640f9a92e25ed6c4f96ad6ef459
4
+ data.tar.gz: 64ebe11f97661fb709c52724b4ef3aced1e6fc9b1341c4afd2e00d668b888dea
5
5
  SHA512:
6
- metadata.gz: 247d21d067a9fcc852d51aabb5b0e835faf9e1b4a34cee7686d74ce9f246eea7d6860174aa0f47a61ea7e871a8f0343b259d710d324f9b05c189fa905101dd7f
7
- data.tar.gz: 1ba3f24ac417148c81370a9d2d760c232a52ee4041c76ae17c3702fade8d56127791219c5153303b6f251a69b9931261e0db3dc81f8f0e7fdde53f904264e1e0
6
+ metadata.gz: 776794c0a09c05871bf4bd3ccc6370cb46b9cbace5213acf09e4598509460bb585b8a55263fdc37191b82bba3eb4707b092ef82258e2a59313e527f22a1860f7
7
+ data.tar.gz: 53a6b5652862a2f053ca06733c7eccd0ea83144ee5f92776eaa6ea4a9002ab3f69b392d7f98ffc3f1991846d3799cf0f099157d5d0fe4fa71a7e444aaa696511
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.106.0 (2021-11-17)
5
+ ------------------
6
+
7
+ * Feature - Add `presigned_request` method to `Aws::S3::Object`.
8
+
4
9
  1.105.1 (2021-11-05)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.105.1
1
+ 1.106.0
@@ -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.105.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
@@ -69,6 +69,6 @@ require_relative 'aws-sdk-s3/event_streams'
69
69
  # @!group service
70
70
  module Aws::S3
71
71
 
72
- GEM_VERSION = '1.105.1'
72
+ GEM_VERSION = '1.106.0'
73
73
 
74
74
  end
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.105.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-05 00:00:00.000000000 Z
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