aws-sdk-s3 1.159.0 → 1.166.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,19 +15,22 @@ module Aws::S3
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::S3::EndpointProvider',
17
17
  rbs_type: 'untyped',
18
- docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
- 'object that responds to `#resolve_endpoint(parameters)` '\
20
- 'where `parameters` is a Struct similar to '\
21
- '`Aws::S3::EndpointParameters`'
22
- ) do |cfg|
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::S3::EndpointParameters`.
22
+ DOCS
23
23
  Aws::S3::EndpointProvider.new
24
24
  end
25
25
 
26
26
  option(
27
27
  :disable_s3_express_session_auth,
28
28
  doc_type: 'Boolean',
29
- default: nil,
30
- docstring: "Parameter to indicate whether S3Express session auth should be disabled")
29
+ docstring: <<~DOCS) do |cfg|
30
+ Parameter to indicate whether S3Express session auth should be disabled
31
+ DOCS
32
+ nil
33
+ end
31
34
 
32
35
  # @api private
33
36
  class Handler < Seahorse::Client::Handler
@@ -46,11 +49,23 @@ module Aws::S3
46
49
  context[:auth_scheme] =
47
50
  Aws::Endpoints.resolve_auth_scheme(context, endpoint)
48
51
 
49
- @handler.call(context)
52
+ with_metrics(context) { @handler.call(context) }
50
53
  end
51
54
 
52
55
  private
53
56
 
57
+ def with_metrics(context, &block)
58
+ metrics = []
59
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
60
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
61
+ metrics << 'SIGV4A_SIGNING'
62
+ end
63
+ if context.config.credentials&.credentials&.account_id
64
+ metrics << 'RESOLVED_ACCOUNT_ID'
65
+ end
66
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
67
+ end
68
+
54
69
  def apply_endpoint_headers(context, headers)
55
70
  headers.each do |key, values|
56
71
  value = values