Class: Aws::S3::Plugins::ExpressSessionAuth::Handler Private

Inherits:
Seahorse::Client::Handler
  • Object
show all
Defined in:
lib/aws-sdk-s3/plugins/express_session_auth.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/aws-sdk-s3/plugins/express_session_auth.rb', line 31

def call(context)
  if (props = context[:endpoint_properties])
    # S3 Express endpoint - turn off md5 and enable crc32 default
    if props['backend'] == 'S3Express'
      if context.operation_name == :put_object || checksum_required?(context)
        context[:default_request_checksum_algorithm] = 'CRC32'
      end
      context[:s3_express_endpoint] = true
    end

    # if s3 express auth, use new credentials and sign additional header
    if context[:auth_scheme]['name'] == 'sigv4-s3express' &&
       !context.config.disable_s3_express_session_auth
      bucket = context.params[:bucket]
      credentials_provider = context.config.express_credentials_provider
      credentials = credentials_provider.express_credentials_for(bucket)
      context[:sigv4_credentials] = credentials # Sign will use this
    end
  end
  with_metric(credentials) { @handler.call(context) }
end