class Aws::Plugins::Sign::Handler

def call(context)

def call(context)
  # Skip signing if using sigv2 signing from s3_signer in S3
  credentials = nil
  unless v2_signing?(context.config)
    signer = Sign.signer_for(
      context[:auth_scheme],
      context.config,
      context[:sigv4_region],
      context[:sigv4_credentials]
    )
    credentials = signer.credentials if signer.is_a?(SignatureV4)
    signer.sign(context)
  end
  with_metrics(credentials) { @handler.call(context) }
end

def v2_signing?(config)

def v2_signing?(config)
  # 's3' is legacy signing, 'v4' is default
  config.respond_to?(:signature_version) &&
    config.signature_version == 's3'
end

def with_metrics(credentials, &block)

def with_metrics(credentials, &block)
  return block.call unless credentials&.respond_to?(:metrics)
  Aws::Plugins::UserAgent.metric(*credentials.metrics, &block)
end