aws-sdk-s3 1.235.0 → 1.237.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: 222ecc56a1d529e21a3539d72a6065fa8b03a30f2a76cefe2b656464c003b094
4
- data.tar.gz: bdb9c728982988008448f8fac5b571277b16896fc36521c678a8ddd48fe89053
3
+ metadata.gz: 6cdd31f47b92588f46be828683224bb7380c4ecebf34c6bbc9e0051f9d2e0729
4
+ data.tar.gz: e8837c0351c4de8de01aa383285c96ac6421dede30b83010c0c6301df30ce559
5
5
  SHA512:
6
- metadata.gz: 7cfb285fdbcbb3fc493209736b5432a034b45fa4b0ce2f0ba14a16f18815e7519a04ade3c04072eb7218781974f323acf0ea5ee4e4a0df298f4e3c61a514240b
7
- data.tar.gz: f385fab3dd0f2eb170755d3d8696db98d054dfbd346d56c3a940ee0fd366a802cbbd30a78dca6e9b9b179d13937831d8eb5fb645124a57738c067fbcbc3dcd76
6
+ metadata.gz: 401fa005d45d910023dfeea7114e95fb990bfbd4c11a5bcc47c0b38703b6f6033c4e3d202fa2955f1a24fd81903f468c58aef9ac62927638ba21e99e4ccad62a
7
+ data.tar.gz: 0e5b729646a07de3aa80b923fd3a6e7af20c6634fbeda6387351844e9f479a5aa550d627f357c7a7ee27a454ff9f00a245a7be45d490d7764b767a5904bc6b63
data/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.237.0 (2026-10-29)
5
+ ------------------
6
+
7
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
8
+
9
+ * Feature - Add `tagging` to `Aws::S3::PresignedPost`, accepting the same tagging structure as `put_object_tagging` and serializing it to XML in the signed POST form.
10
+
11
+ * Feature - Reduce object allocation overhead when generating S3 presigned URLs.
12
+
13
+ 1.236.0 (2026-10-28)
14
+ ------------------
15
+
16
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
17
+
18
+ * Issue - Create and cache S3 Express sessions using the credentials of the requesting client.
19
+
4
20
  1.235.0 (2026-10-20)
5
21
  ------------------
6
22
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.235.0
1
+ 1.237.0
@@ -24216,7 +24216,7 @@ module Aws::S3
24216
24216
  tracer: tracer
24217
24217
  )
24218
24218
  context[:gem_name] = 'aws-sdk-s3'
24219
- context[:gem_version] = '1.235.0'
24219
+ context[:gem_version] = '1.237.0'
24220
24220
  Seahorse::Client::Request.new(handlers, context)
24221
24221
  end
24222
24222
 
@@ -14,6 +14,7 @@ module Aws
14
14
 
15
15
  def initialize(options = {})
16
16
  @client = options[:client]
17
+ @base_credentials = options[:base_credentials]
17
18
  @create_session_params = {}
18
19
  options.each_pair do |key, value|
19
20
  if self.class.create_session_options.include?(key)
@@ -30,7 +31,9 @@ module Aws
30
31
  private
31
32
 
32
33
  def refresh
33
- c = @client.create_session(@create_session_params).credentials
34
+ request = @client.build_request(:create_session, @create_session_params)
35
+ request.context[:sigv4_credentials] = @base_credentials if @base_credentials
36
+ c = request.send_request.credentials
34
37
  @credentials = Credentials.new(
35
38
  c.access_key_id,
36
39
  c.secret_access_key,
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'securerandom'
4
+
3
5
  module Aws
4
6
  module S3
5
7
  # @api private
@@ -10,9 +12,12 @@ module Aws
10
12
  # Returns Credentials class for S3 Express. Accepts CreateSession
11
13
  # params as options. See {Client#create_session} for details.
12
14
  class ExpressCredentialsProvider
15
+ CACHE_KEY_SECRET = SecureRandom.random_bytes(64)
16
+ private_constant :CACHE_KEY_SECRET
17
+
13
18
  # @param [Hash] options
14
19
  # @option options [Client] :client The S3 client used to create the
15
- # session.
20
+ # session when one is not given to {#express_credentials_for}.
16
21
  # @option options [String] :session_mode (see: {Client#create_session})
17
22
  # @option options [Boolean] :caching (true) When true, credentials will
18
23
  # be cached.
@@ -27,11 +32,12 @@ module Aws
27
32
  @cache = Aws::S3.express_credentials_cache
28
33
  end
29
34
 
30
- def express_credentials_for(bucket)
35
+ def express_credentials_for(bucket, client = @client)
36
+ credentials = client.config.credentials&.credentials
31
37
  if @caching
32
- cached_credentials_for(bucket)
38
+ cached_credentials_for(bucket, client, credentials)
33
39
  else
34
- new_credentials_for(bucket)
40
+ new_credentials_for(bucket, client, credentials)
35
41
  end
36
42
  end
37
43
 
@@ -39,18 +45,23 @@ module Aws
39
45
 
40
46
  private
41
47
 
42
- def cached_credentials_for(bucket)
43
- if @cache.key?(bucket)
44
- @cache[bucket]
45
- else
46
- @cache[bucket] = new_credentials_for(bucket)
47
- end
48
+ def cached_credentials_for(bucket, client, credentials)
49
+ @cache[cache_key(bucket, credentials)] ||= new_credentials_for(bucket, client, credentials)
50
+ end
51
+
52
+ def cache_key(bucket, credentials)
53
+ identity = "#{credentials&.access_key_id}#{credentials&.secret_access_key}"
54
+ "#{OpenSSL::HMAC.hexdigest('SHA256', CACHE_KEY_SECRET, identity)}#{bucket}"
48
55
  end
49
56
 
50
- def new_credentials_for(bucket)
57
+ def new_credentials_for(bucket, client, credentials)
58
+ # Sign with this snapshot, but report the provider's UserAgent metrics.
59
+ credentials = credentials&.dup
60
+ credentials&.metrics = client.config.credentials.metrics
51
61
  ExpressCredentials.new(
52
62
  bucket: bucket,
53
- client: @client,
63
+ client: client,
64
+ base_credentials: credentials,
54
65
  **@options
55
66
  )
56
67
  end
@@ -35,8 +35,7 @@ for different buckets.
35
35
  if context[:auth_scheme]['name'] == 'sigv4-s3express' &&
36
36
  !context.config.disable_s3_express_session_auth
37
37
  bucket = context.params[:bucket]
38
- credentials_provider = context.config.express_credentials_provider
39
- credentials = credentials_provider.express_credentials_for(bucket)
38
+ credentials = express_credentials_for(context, bucket)
40
39
  context[:sigv4_credentials] = credentials # Sign will use this
41
40
  end
42
41
 
@@ -45,6 +44,15 @@ for different buckets.
45
44
 
46
45
  private
47
46
 
47
+ def express_credentials_for(context, bucket)
48
+ provider = context.config.express_credentials_provider
49
+ if provider.is_a?(ExpressCredentialsProvider)
50
+ provider.express_credentials_for(bucket, context.client)
51
+ else
52
+ provider.express_credentials_for(bucket)
53
+ end
54
+ end
55
+
48
56
  def with_metric(credentials, &block)
49
57
  return block.call unless credentials
50
58
 
@@ -155,7 +155,7 @@ module Aws
155
155
  #
156
156
  # The string `${filename}` is automatically replaced with the name of the
157
157
  # file provided by the user and is recognized by all form fields. It is
158
- # not supported with `starts_with` conditions.
158
+ # not supported with `starts_with` conditions or {#tagging}.
159
159
  #
160
160
  # If the browser or client provides a full or partial path to the file,
161
161
  # only the text following the last slash (/) or backslash (\) will be used
@@ -175,6 +175,28 @@ module Aws
175
175
  # })
176
176
  # ```
177
177
  #
178
+ # ### Object Tags
179
+ #
180
+ # Use `:tagging` or {#tagging} to add tags to the uploaded object. Pass
181
+ # the same structure as the `:tagging` parameter of
182
+ # {Client#put_object_tagging}. The SDK serializes it to XML and adds
183
+ # an exact-match condition to the POST policy.
184
+ #
185
+ # ```ruby
186
+ # post = bucket.presigned_post(
187
+ # key: 'object-key',
188
+ # tagging: { tag_set: [{ key: 'project', value: 'example' }] }
189
+ # )
190
+ #
191
+ # # Or set tags on an existing presigned post:
192
+ # post = bucket.presigned_post(key: 'object-key')
193
+ # post.tagging(tag_set: [{ key: 'project', value: 'example' }])
194
+ # ```
195
+ #
196
+ # Include `post.fields['tagging']` unchanged in the submitted form.
197
+ # When rendering it as an HTML input value, HTML-escape it just like
198
+ # the other form fields.
199
+ #
178
200
  class PresignedPost
179
201
  @@allowed_fields = []
180
202
 
@@ -240,6 +262,8 @@ module Aws
240
262
  # See {PresignedPost#server_side_encryption_customer_key}.
241
263
  # @option options [String] :server_side_encryption_customer_key_starts_with
242
264
  # See {PresignedPost#server_side_encryption_customer_key_starts_with}.
265
+ # @option options [Hash, Types::Tagging] :tagging
266
+ # See {PresignedPost#tagging}.
243
267
  def initialize(credentials, bucket_region, bucket_name, options = {})
244
268
  @credentials = credentials.credentials
245
269
  @bucket_region = bucket_region
@@ -605,6 +629,31 @@ module Aws
605
629
 
606
630
  # @!endgroup
607
631
 
632
+ # @!group Object Tagging
633
+
634
+ # @!method tagging(value)
635
+ # Tags to store with the uploaded object. Accepts the same structure
636
+ # as the `:tagging` parameter of {Client#put_object_tagging}, containing
637
+ # a required `:tag_set` array of tags with `:key` and `:value` strings.
638
+ # Serializes the tags to XML and requires an exact match in the POST
639
+ # policy. The `${filename}` variable is not supported in tags.
640
+ #
641
+ # @example
642
+ # post.tagging(tag_set: [{ key: 'project', value: 'example' }])
643
+ #
644
+ # @param [Hash, Types::Tagging] value
645
+ # @raise [ArgumentError] If the tagging parameters are invalid.
646
+ # @see Client#put_object_tagging
647
+ # @return [self]
648
+ define_field(:tagging) do |value|
649
+ rules = Client.api.operation(:put_object_tagging).input.shape.member(:tagging)
650
+ value = Aws::ParamConverter.convert(rules, value)
651
+ Aws::ParamValidator.validate!(rules, value)
652
+ with('tagging', Aws::Xml::Builder.new(rules).serialize(value))
653
+ end
654
+
655
+ # @!endgroup
656
+
608
657
  private
609
658
 
610
659
  def with(field_name, value)
@@ -251,7 +251,7 @@ module Aws
251
251
  time: time
252
252
  ).to_s
253
253
 
254
- Seahorse::Client::Response.new(context: context, data: url)
254
+ Aws::Response.new(context: context, data: url)
255
255
  end
256
256
  # Return the headers
257
257
  x_amz_headers
data/lib/aws-sdk-s3.rb CHANGED
@@ -75,7 +75,7 @@ module Aws::S3
75
75
  autoload :ObjectVersion, 'aws-sdk-s3/object_version'
76
76
  autoload :EventStreams, 'aws-sdk-s3/event_streams'
77
77
 
78
- GEM_VERSION = '1.235.0'
78
+ GEM_VERSION = '1.237.0'
79
79
 
80
80
  end
81
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.235.0
4
+ version: 1.237.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '3'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 3.258.0
49
+ version: 3.263.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,7 +56,7 @@ dependencies:
56
56
  version: '3'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 3.258.0
59
+ version: 3.263.0
60
60
  description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
61
61
  This gem is part of the AWS SDK for Ruby.
62
62
  email: