aws-sdk-core 3.98.0 → 3.102.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.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/aws-sdk-core.rb +2 -0
  4. data/lib/aws-sdk-core/arn.rb +2 -0
  5. data/lib/aws-sdk-core/arn_parser.rb +2 -0
  6. data/lib/aws-sdk-core/assume_role_credentials.rb +2 -0
  7. data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +2 -0
  8. data/lib/aws-sdk-core/async_client_stubs.rb +2 -0
  9. data/lib/aws-sdk-core/binary.rb +2 -0
  10. data/lib/aws-sdk-core/binary/decode_handler.rb +2 -0
  11. data/lib/aws-sdk-core/binary/encode_handler.rb +2 -0
  12. data/lib/aws-sdk-core/binary/event_builder.rb +2 -0
  13. data/lib/aws-sdk-core/binary/event_parser.rb +2 -0
  14. data/lib/aws-sdk-core/binary/event_stream_decoder.rb +2 -0
  15. data/lib/aws-sdk-core/binary/event_stream_encoder.rb +2 -0
  16. data/lib/aws-sdk-core/client_side_monitoring/publisher.rb +2 -0
  17. data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +2 -0
  18. data/lib/aws-sdk-core/client_stubs.rb +2 -0
  19. data/lib/aws-sdk-core/credential_provider.rb +2 -0
  20. data/lib/aws-sdk-core/credential_provider_chain.rb +2 -0
  21. data/lib/aws-sdk-core/credentials.rb +2 -0
  22. data/lib/aws-sdk-core/deprecations.rb +2 -0
  23. data/lib/aws-sdk-core/eager_loader.rb +2 -0
  24. data/lib/aws-sdk-core/ecs_credentials.rb +2 -0
  25. data/lib/aws-sdk-core/endpoint_cache.rb +2 -0
  26. data/lib/aws-sdk-core/errors.rb +34 -6
  27. data/lib/aws-sdk-core/event_emitter.rb +2 -0
  28. data/lib/aws-sdk-core/ini_parser.rb +2 -0
  29. data/lib/aws-sdk-core/instance_profile_credentials.rb +2 -0
  30. data/lib/aws-sdk-core/json.rb +2 -0
  31. data/lib/aws-sdk-core/json/builder.rb +2 -0
  32. data/lib/aws-sdk-core/json/error_handler.rb +2 -0
  33. data/lib/aws-sdk-core/json/handler.rb +2 -0
  34. data/lib/aws-sdk-core/json/json_engine.rb +2 -0
  35. data/lib/aws-sdk-core/json/oj_engine.rb +2 -0
  36. data/lib/aws-sdk-core/json/parser.rb +2 -0
  37. data/lib/aws-sdk-core/log/formatter.rb +8 -2
  38. data/lib/aws-sdk-core/log/handler.rb +2 -0
  39. data/lib/aws-sdk-core/log/param_filter.rb +29 -12
  40. data/lib/aws-sdk-core/log/param_formatter.rb +2 -0
  41. data/lib/aws-sdk-core/pageable_response.rb +2 -0
  42. data/lib/aws-sdk-core/pager.rb +2 -0
  43. data/lib/aws-sdk-core/param_converter.rb +2 -0
  44. data/lib/aws-sdk-core/param_validator.rb +2 -0
  45. data/lib/aws-sdk-core/plugins/api_key.rb +2 -0
  46. data/lib/aws-sdk-core/plugins/apig_authorizer_token.rb +2 -0
  47. data/lib/aws-sdk-core/plugins/apig_credentials_configuration.rb +2 -0
  48. data/lib/aws-sdk-core/plugins/apig_user_agent.rb +2 -0
  49. data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +2 -0
  50. data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +2 -0
  51. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +2 -0
  52. data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +2 -0
  53. data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +2 -0
  54. data/lib/aws-sdk-core/plugins/event_stream_configuration.rb +2 -0
  55. data/lib/aws-sdk-core/plugins/global_configuration.rb +2 -0
  56. data/lib/aws-sdk-core/plugins/helpful_socket_errors.rb +2 -0
  57. data/lib/aws-sdk-core/plugins/http_checksum.rb +57 -0
  58. data/lib/aws-sdk-core/plugins/idempotency_token.rb +2 -0
  59. data/lib/aws-sdk-core/plugins/invocation_id.rb +2 -0
  60. data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +2 -0
  61. data/lib/aws-sdk-core/plugins/logging.rb +2 -0
  62. data/lib/aws-sdk-core/plugins/param_converter.rb +2 -0
  63. data/lib/aws-sdk-core/plugins/param_validator.rb +2 -0
  64. data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +2 -0
  65. data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -0
  66. data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +2 -0
  67. data/lib/aws-sdk-core/plugins/protocols/query.rb +2 -0
  68. data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +2 -0
  69. data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +2 -0
  70. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +19 -14
  71. data/lib/aws-sdk-core/plugins/response_paging.rb +2 -0
  72. data/lib/aws-sdk-core/plugins/retries/client_rate_limiter.rb +2 -0
  73. data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +2 -0
  74. data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +2 -0
  75. data/lib/aws-sdk-core/plugins/retries/retry_quota.rb +2 -0
  76. data/lib/aws-sdk-core/plugins/retry_errors.rb +2 -0
  77. data/lib/aws-sdk-core/plugins/signature_v2.rb +2 -0
  78. data/lib/aws-sdk-core/plugins/signature_v4.rb +2 -0
  79. data/lib/aws-sdk-core/plugins/stub_responses.rb +2 -0
  80. data/lib/aws-sdk-core/plugins/transfer_encoding.rb +2 -0
  81. data/lib/aws-sdk-core/plugins/user_agent.rb +2 -0
  82. data/lib/aws-sdk-core/process_credentials.rb +3 -2
  83. data/lib/aws-sdk-core/query.rb +2 -0
  84. data/lib/aws-sdk-core/query/ec2_param_builder.rb +2 -0
  85. data/lib/aws-sdk-core/query/handler.rb +2 -0
  86. data/lib/aws-sdk-core/query/param.rb +2 -0
  87. data/lib/aws-sdk-core/query/param_builder.rb +2 -0
  88. data/lib/aws-sdk-core/query/param_list.rb +2 -0
  89. data/lib/aws-sdk-core/refreshing_credentials.rb +2 -0
  90. data/lib/aws-sdk-core/resources/collection.rb +2 -0
  91. data/lib/aws-sdk-core/rest.rb +2 -0
  92. data/lib/aws-sdk-core/rest/handler.rb +2 -0
  93. data/lib/aws-sdk-core/rest/request/body.rb +2 -0
  94. data/lib/aws-sdk-core/rest/request/builder.rb +2 -0
  95. data/lib/aws-sdk-core/rest/request/endpoint.rb +2 -0
  96. data/lib/aws-sdk-core/rest/request/headers.rb +2 -0
  97. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +2 -0
  98. data/lib/aws-sdk-core/rest/response/body.rb +2 -0
  99. data/lib/aws-sdk-core/rest/response/headers.rb +2 -0
  100. data/lib/aws-sdk-core/rest/response/parser.rb +2 -0
  101. data/lib/aws-sdk-core/rest/response/status_code.rb +2 -0
  102. data/lib/aws-sdk-core/shared_config.rb +2 -0
  103. data/lib/aws-sdk-core/shared_credentials.rb +2 -0
  104. data/lib/aws-sdk-core/structure.rb +3 -1
  105. data/lib/aws-sdk-core/stubbing/data_applicator.rb +2 -0
  106. data/lib/aws-sdk-core/stubbing/empty_stub.rb +2 -0
  107. data/lib/aws-sdk-core/stubbing/protocols/api_gateway.rb +2 -0
  108. data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +2 -0
  109. data/lib/aws-sdk-core/stubbing/protocols/json.rb +2 -0
  110. data/lib/aws-sdk-core/stubbing/protocols/query.rb +2 -0
  111. data/lib/aws-sdk-core/stubbing/protocols/rest.rb +2 -0
  112. data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +2 -0
  113. data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +2 -0
  114. data/lib/aws-sdk-core/stubbing/stub_data.rb +2 -0
  115. data/lib/aws-sdk-core/stubbing/xml_error.rb +2 -0
  116. data/lib/aws-sdk-core/type_builder.rb +2 -0
  117. data/lib/aws-sdk-core/util.rb +2 -0
  118. data/lib/aws-sdk-core/waiters.rb +2 -0
  119. data/lib/aws-sdk-core/waiters/errors.rb +2 -0
  120. data/lib/aws-sdk-core/waiters/poller.rb +2 -0
  121. data/lib/aws-sdk-core/waiters/waiter.rb +2 -0
  122. data/lib/aws-sdk-core/xml.rb +2 -0
  123. data/lib/aws-sdk-core/xml/builder.rb +2 -0
  124. data/lib/aws-sdk-core/xml/default_list.rb +2 -0
  125. data/lib/aws-sdk-core/xml/default_map.rb +2 -0
  126. data/lib/aws-sdk-core/xml/doc_builder.rb +2 -0
  127. data/lib/aws-sdk-core/xml/error_handler.rb +2 -0
  128. data/lib/aws-sdk-core/xml/parser.rb +2 -0
  129. data/lib/aws-sdk-core/xml/parser/engines/libxml.rb +2 -0
  130. data/lib/aws-sdk-core/xml/parser/engines/nokogiri.rb +2 -0
  131. data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
  132. data/lib/aws-sdk-core/xml/parser/engines/ox.rb +2 -0
  133. data/lib/aws-sdk-core/xml/parser/engines/rexml.rb +2 -0
  134. data/lib/aws-sdk-core/xml/parser/frame.rb +2 -0
  135. data/lib/aws-sdk-core/xml/parser/parsing_error.rb +2 -0
  136. data/lib/aws-sdk-core/xml/parser/stack.rb +2 -0
  137. data/lib/aws-sdk-sts.rb +3 -1
  138. data/lib/aws-sdk-sts/client.rb +6 -2
  139. data/lib/aws-sdk-sts/client_api.rb +2 -0
  140. data/lib/aws-sdk-sts/customizations.rb +2 -0
  141. data/lib/aws-sdk-sts/errors.rb +2 -0
  142. data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +2 -0
  143. data/lib/aws-sdk-sts/presigner.rb +2 -0
  144. data/lib/aws-sdk-sts/resource.rb +2 -0
  145. data/lib/aws-sdk-sts/types.rb +30 -0
  146. data/lib/seahorse.rb +2 -0
  147. data/lib/seahorse/client/async_base.rb +2 -0
  148. data/lib/seahorse/client/async_response.rb +2 -0
  149. data/lib/seahorse/client/base.rb +2 -0
  150. data/lib/seahorse/client/block_io.rb +3 -0
  151. data/lib/seahorse/client/configuration.rb +2 -0
  152. data/lib/seahorse/client/events.rb +2 -0
  153. data/lib/seahorse/client/h2/connection.rb +2 -0
  154. data/lib/seahorse/client/h2/handler.rb +2 -0
  155. data/lib/seahorse/client/handler.rb +2 -0
  156. data/lib/seahorse/client/handler_builder.rb +2 -0
  157. data/lib/seahorse/client/handler_list.rb +2 -0
  158. data/lib/seahorse/client/handler_list_entry.rb +2 -0
  159. data/lib/seahorse/client/http/async_response.rb +2 -0
  160. data/lib/seahorse/client/http/headers.rb +2 -0
  161. data/lib/seahorse/client/http/request.rb +2 -0
  162. data/lib/seahorse/client/http/response.rb +2 -0
  163. data/lib/seahorse/client/logging/formatter.rb +2 -0
  164. data/lib/seahorse/client/logging/handler.rb +2 -0
  165. data/lib/seahorse/client/managed_file.rb +2 -0
  166. data/lib/seahorse/client/net_http/connection_pool.rb +2 -0
  167. data/lib/seahorse/client/net_http/handler.rb +2 -0
  168. data/lib/seahorse/client/net_http/patches.rb +2 -0
  169. data/lib/seahorse/client/networking_error.rb +2 -0
  170. data/lib/seahorse/client/plugin.rb +2 -0
  171. data/lib/seahorse/client/plugin_list.rb +2 -0
  172. data/lib/seahorse/client/plugins/content_length.rb +2 -0
  173. data/lib/seahorse/client/plugins/endpoint.rb +4 -2
  174. data/lib/seahorse/client/plugins/h2.rb +2 -0
  175. data/lib/seahorse/client/plugins/logging.rb +2 -0
  176. data/lib/seahorse/client/plugins/net_http.rb +2 -0
  177. data/lib/seahorse/client/plugins/operation_methods.rb +2 -0
  178. data/lib/seahorse/client/plugins/raise_response_errors.rb +2 -0
  179. data/lib/seahorse/client/plugins/response_target.rb +18 -7
  180. data/lib/seahorse/client/request.rb +2 -0
  181. data/lib/seahorse/client/request_context.rb +2 -0
  182. data/lib/seahorse/client/response.rb +2 -0
  183. data/lib/seahorse/model/api.rb +2 -0
  184. data/lib/seahorse/model/authorizer.rb +2 -0
  185. data/lib/seahorse/model/operation.rb +5 -0
  186. data/lib/seahorse/model/shapes.rb +2 -0
  187. data/lib/seahorse/util.rb +2 -0
  188. data/lib/seahorse/version.rb +2 -0
  189. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 900cd1a6cbe9b35c88cabe17a5722dc050118ae959fc95e314c9d6b37d50fa2f
4
- data.tar.gz: 72ec66eb30d622b0b4fbdfa2a3d6c63e7b9a1667dd0d8a72ec2f7bece92212e6
3
+ metadata.gz: 7fc179e3e488a2fd1bd6f0db5ad586d094778cf9a21c1e382b62151118225df6
4
+ data.tar.gz: cc9d9832e1151e79ccb81c70351e80afd7def92f78e8296e9cd9f8555b9a66a0
5
5
  SHA512:
6
- metadata.gz: 79c25a4a03c167df01e62959cd8613ff3f62a4cbca3a1d8202c4327ea0dbb1db7e797ae4c1b6ab3b35483179e00965c587d71f0e8c2414cd87016a02d66e2aa8
7
- data.tar.gz: bb899f25cdc80a804e11b31881dba290cba5512c8ccd935135a52a93767d12cad8affa7700e91c2a3ef6955080a5071398220735ae8c9f16f36b9eb4c41654c6
6
+ metadata.gz: d86af36d1803a57aa45edd30786568b6ed0976b348e02fb2012e726016d5b6d15c1143425aea1b1af0c85b2e11ac943f01cc3596c6c6969b38b6085eb68f7d02
7
+ data.tar.gz: 14c968ab6c605de0fa58ab06268c07abae32642c54ef7742a6ebd0db1006f44226f072276bcb119bbc16e19f10e551d72141d7214400769d42264c65bafc45c9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.98.0
1
+ 3.102.0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'aws-partitions'
2
4
  require 'seahorse'
3
5
  require 'jmespath'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  # Create and provide access to components of Amazon Resource Names (ARN).
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module ARNParser
3
5
  # Parse a string with an ARN format into an {Aws::ARN} object.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
 
3
5
  module Aws
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
  require 'securerandom'
3
5
  require 'base64'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module AsyncClientStubs
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'binary/decode_handler'
2
4
  require_relative 'binary/encode_handler'
3
5
  require_relative 'binary/event_stream_decoder'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Binary
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Binary
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Binary
3
5
  # @api private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Binary
3
5
  # @api private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'aws-eventstream'
2
4
 
3
5
  module Aws
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'aws-eventstream'
2
4
 
3
5
  module Aws
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'thread'
2
4
  require 'socket'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module ClientSideMonitoring
3
5
  # @api private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'thread'
2
4
 
3
5
  module Aws
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module CredentialProvider
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  # @api private
3
5
  class CredentialProviderChain
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  class Credentials
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
 
3
5
  # A utility module that provides a class method that wraps
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
 
3
5
  module Aws
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require 'time'
3
5
  require 'net/http'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  # @api private
3
5
  # a LRU cache caching endpoints data
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Errors
3
5
 
@@ -208,12 +210,40 @@ module Aws
208
210
  # Raised when a client is constructed and region is not specified.
209
211
  class MissingRegionError < ArgumentError
210
212
  def initialize(*args)
211
- msg = 'missing region; use :region option or '\
212
- "export region name to ENV['AWS_REGION']"
213
+ msg = 'No region was provided. Configure the `:region` option or '\
214
+ "export the region name to ENV['AWS_REGION']"
213
215
  super(msg)
214
216
  end
215
217
  end
216
218
 
219
+ # Raised when a client is contsructed and the region is not valid.
220
+ class InvalidRegionError < ArgumentError
221
+ def initialize(*args)
222
+ super(<<-MSG)
223
+ Invalid `:region` option was provided.
224
+
225
+ * Not every service is available in every region.
226
+
227
+ * Never suffix region names with availability zones.
228
+ Use "us-east-1", not "us-east-1a"
229
+
230
+ Known AWS regions include (not specific to this service):
231
+
232
+ #{possible_regions}
233
+ MSG
234
+ end
235
+
236
+ private
237
+
238
+ def possible_regions
239
+ Aws.partitions.each_with_object([]) do |partition, region_names|
240
+ partition.regions.each do |region|
241
+ region_names << region.name
242
+ end
243
+ end.join("\n")
244
+ end
245
+ end
246
+
217
247
  # Raised when attempting to connect to an endpoint and a `SocketError`
218
248
  # is received from the HTTP client. This error is typically the result
219
249
  # of configuring an invalid `:region`.
@@ -226,7 +256,7 @@ module Aws
226
256
  super(<<-MSG)
227
257
  Encountered a `SocketError` while attempting to connect to:
228
258
 
229
- #{endpoint.to_s}
259
+ #{endpoint}
230
260
 
231
261
  This is typically the result of an invalid `:region` option or a
232
262
  poorly formatted `:endpoint` option.
@@ -255,14 +285,12 @@ Known AWS regions include (not specific to this service):
255
285
  private
256
286
 
257
287
  def possible_regions
258
- Aws.partitions.inject([]) do |region_names, partition|
288
+ Aws.partitions.each_with_object([]) do |partition, region_names|
259
289
  partition.regions.each do |region|
260
290
  region_names << region.name
261
291
  end
262
- region_names
263
292
  end.join("\n")
264
293
  end
265
-
266
294
  end
267
295
 
268
296
  # Raised when attempting to retry a request
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  class EventEmitter
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  # @api private
3
5
  class IniParser
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require 'time'
3
5
  require 'net/http'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require_relative 'json/builder'
3
5
  require_relative 'json/error_handler'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'base64'
2
4
 
3
5
  module Aws
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Json
3
5
  class ErrorHandler < Xml::ErrorHandler
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Json
3
5
  class Handler < Seahorse::Client::Handler
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Json
3
5
  class OjEngine
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module Json
3
5
  class JSONEngine
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'base64'
2
4
  require 'time'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pathname'
2
4
 
3
5
  module Aws
@@ -83,6 +85,9 @@ module Aws
83
85
  # The default list of filtered parameters is documented on the
84
86
  # {ParamFilter} class.
85
87
  #
88
+ # @option options [Boolean] :filter_sensitive_params (true) Set to false
89
+ # to disable the sensitive parameter filtering when logging
90
+ # `:request_params`.
86
91
  def initialize(pattern, options = {})
87
92
  @pattern = pattern
88
93
  @param_formatter = ParamFormatter.new(options)
@@ -97,7 +102,7 @@ module Aws
97
102
  # @param [Seahorse::Client::Response] response
98
103
  # @return [String]
99
104
  def format(response)
100
- pattern.gsub(/:(\w+)/) {|sym| send("_#{sym[1..-1]}", response) }
105
+ pattern.gsub(/:(\w+)/) { |sym| send("_#{sym[1..-1]}", response) }
101
106
  end
102
107
 
103
108
  # @api private
@@ -121,7 +126,8 @@ module Aws
121
126
 
122
127
  def _request_params(response)
123
128
  params = response.context.params
124
- @param_formatter.summarize(@param_filter.filter(params))
129
+ type = response.context.operation.input.shape.struct_class
130
+ @param_formatter.summarize(@param_filter.filter(params, type))
125
131
  end
126
132
 
127
133
  def _time(response)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Seahorse
2
4
  module Client
3
5
  module Logging
@@ -1,43 +1,60 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pathname'
2
4
  require 'set'
3
5
 
4
6
  module Aws
5
7
  module Log
6
8
  class ParamFilter
7
-
9
+ # DEPRECATED - this must exist for backwards compatibility. Sensitive
10
+ # members are now computed for each request/response type. This can be
11
+ # removed in a new major version.
12
+ #
8
13
  # A managed list of sensitive parameters that should be filtered from
9
14
  # logs. This is updated automatically as part of each release. See the
10
15
  # `tasks/update-sensitive-params.rake` for more information.
11
16
  #
12
17
  # @api private
13
18
  # begin
14
- SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :alexa_for_business_room_arn, :artifact_credentials, :auth_code, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :block, :block_address, :block_data, :blocks, :body, :bot_configuration, :bot_email, :calling_name, :cause, :client_id, :client_request_token, :client_secret, :comment, :configuration, :copy_source_sse_customer_key, :credentials, :current_password, :custom_attributes, :custom_private_key, :db_password, :default_phone_number, :definition, :description, :destination_access_token, :digest_tip_address, :display_name, :domain_signing_private_key, :e164_phone_number, :email, :email_address, :email_message, :embed_url, :error, :external_meeting_id, :external_model_endpoint_data_blobs, :external_user_id, :fall_back_phone_number, :feedback_token, :file, :filter_expression, :first_name, :full_name, :host_key, :id, :id_token, :input, :input_text, :ion_text, :join_token, :key, :key_id, :key_material, :key_store_password, :kms_key_id, :kms_master_key_id, :lambda_function_arn, :last_name, :local_console_password, :master_account_email, :master_user_name, :master_user_password, :meeting_host_id, :message, :metadata, :name, :new_password, :next_password, :notes, :number, :old_password, :outbound_events_https_endpoint, :output, :owner_information, :parameters, :passphrase, :password, :payload, :phone_number, :plaintext, :previous_password, :primary_email, :primary_provisioned_number, :private_key, :private_key_plaintext, :proof, :proposed_password, :proxy_phone_number, :public_key, :qr_code_png, :query, :random_password, :recovery_point_tags, :refresh_token, :registrant_contact, :request_attributes, :resource_arn, :restore_metadata, :revision, :saml_assertion, :search_query, :secret_access_key, :secret_binary, :secret_code, :secret_hash, :secret_string, :secret_to_authenticate_initiator, :secret_to_authenticate_target, :security_token, :service_password, :session_attributes, :session_token, :share_notes, :shared_secret, :slots, :sns_topic_arn, :source_access_token, :sqs_queue_arn, :sse_customer_key, :ssekms_encryption_context, :ssekms_key_id, :status_message, :tag_key_list, :tags, :target_address, :task_parameters, :tech_contact, :temporary_password, :text, :token, :trust_password, :type, :upload_credentials, :upload_url, :uri, :user_data, :user_email, :user_name, :user_password, :username, :value, :values, :variables, :vpn_psk, :web_identity_token, :zip_file]
19
+ SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :alexa_for_business_room_arn, :artifact_credentials, :auth_code, :auth_parameters, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :basic_auth_credentials, :block, :block_address, :block_data, :blocks, :body, :bot_configuration, :bot_email, :calling_name, :cause, :client_id, :client_request_token, :client_secret, :comment, :configuration, :content, :copy_source_sse_customer_key, :credentials, :current_password, :custom_attributes, :custom_private_key, :db_password, :default_phone_number, :definition, :description, :destination_access_token, :digest_tip_address, :display_name, :domain_signing_private_key, :e164_phone_number, :email, :email_address, :email_message, :embed_url, :error, :external_meeting_id, :external_model_endpoint_data_blobs, :external_user_id, :fall_back_phone_number, :feedback_token, :file, :filter_expression, :first_name, :full_name, :host_key, :id, :id_token, :input, :input_text, :ion_text, :join_token, :key, :key_id, :key_material, :key_store_password, :kms_key_id, :kms_master_key_id, :lambda_function_arn, :last_name, :local_console_password, :master_account_email, :master_user_name, :master_user_password, :meeting_host_id, :message, :metadata, :name, :new_password, :next_password, :notes, :number, :oauth_token, :old_password, :outbound_events_https_endpoint, :output, :owner_information, :parameters, :passphrase, :password, :payload, :phone_number, :plaintext, :previous_password, :primary_email, :primary_provisioned_number, :private_key, :private_key_plaintext, :proof, :proposed_password, :proxy_phone_number, :public_key, :qr_code_png, :query, :random_password, :recovery_point_tags, :refresh_token, :registrant_contact, :request_attributes, :resource_arn, :restore_metadata, :revision, :saml_assertion, :search_query, :secret_access_key, :secret_binary, :secret_code, :secret_hash, :secret_string, :secret_to_authenticate_initiator, :secret_to_authenticate_target, :security_token, :service_password, :session_attributes, :session_token, :share_notes, :shared_secret, :slots, :sns_topic_arn, :source_access_token, :sqs_queue_arn, :sse_customer_key, :ssekms_encryption_context, :ssekms_key_id, :status_message, :tag_key_list, :tags, :target_address, :task_parameters, :tech_contact, :temporary_password, :text, :token, :trust_password, :type, :upload_credentials, :upload_url, :uri, :user_data, :user_email, :user_name, :user_password, :username, :value, :values, :variables, :vpn_psk, :web_identity_token, :zip_file]
15
20
  # end
16
21
 
17
22
  def initialize(options = {})
18
- @filters = Set.new(SENSITIVE + Array(options[:filter]))
23
+ @enabled = options[:filter_sensitive_params] != false
24
+ @additional_filters = options[:filter] || []
19
25
  end
20
26
 
21
- def filter(value)
22
- case value
23
- when Struct, Hash then filter_hash(value)
24
- when Array then filter_array(value)
25
- else value
27
+ def filter(values, type)
28
+ case values
29
+ when Struct, Hash then filter_hash(values, type)
30
+ when Array then filter_array(values, type)
31
+ else values
26
32
  end
27
33
  end
28
34
 
29
35
  private
30
36
 
31
- def filter_hash(values)
37
+ def filter_hash(values, type)
38
+ if type.const_defined?('SENSITIVE')
39
+ filters = type::SENSITIVE + @additional_filters
40
+ else
41
+ # Support backwards compatibility (new core + old service)
42
+ filters = SENSITIVE + @additional_filters
43
+ end
44
+
32
45
  filtered = {}
33
46
  values.each_pair do |key, value|
34
- filtered[key] = @filters.any? { |f| f.to_s.casecmp(key.to_s).zero? } ? '[FILTERED]' : filter(value)
47
+ filtered[key] = if @enabled && filters.include?(key)
48
+ '[FILTERED]'
49
+ else
50
+ filter(value, type)
51
+ end
35
52
  end
36
53
  filtered
37
54
  end
38
55
 
39
- def filter_array(values)
40
- values.map { |value| filter(value) }
56
+ def filter_array(values, type)
57
+ values.map { |value| filter(value, type) }
41
58
  end
42
59
 
43
60
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pathname'
2
4
 
3
5
  module Aws
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
 
3
5
  # Decorates a {Seahorse::Client::Response} with paging convenience methods.