Class: Aws::Plugins::ChecksumAlgorithm Private

Inherits:
Seahorse::Client::Plugin show all
Defined in:
lib/aws-sdk-core/plugins/checksum_algorithm.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.

Defined Under Namespace

Classes: AwsChunkedTrailerDigestIO, ChecksumHandler, Digest32, OptionHandler

Constant Summary collapse

CHUNK_SIZE =

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

one MB

1 * 1024 * 1024
CLIENT_ALGORITHMS =

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

determine the set of supported client side checksum algorithms CRC32c requires aws-crt (optional sdk dependency) for support

begin
  supported = %w[SHA256 SHA1 CRC32]
  begin
    require 'aws-crt'
    supported << 'CRC32C'
  rescue LoadError
  end
  supported
end.freeze
CHECKSUM_ALGORITHM_PRIORITIES =

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

priority order of checksum algorithms to validate responses against Remove any algorithms not supported by client (ie, depending on CRT availability)

%w[CRC32C SHA1 CRC32 SHA256] & CLIENT_ALGORITHMS
CHECKSUM_SIZE =

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

byte size of checksums, used in computing the trailer length

{
  'CRC32' => 16,
  'CRC32C' => 16,
  'SHA1' => 36,
  'SHA256' => 52
}

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_options, #after_initialize, after_initialize, after_initialize_hooks, before_initialize, #before_initialize, before_initialize_hooks, handlers, literal, option, options

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response, #handler_for, #new_handler

Instance Method Details

#add_handlers(handlers, _config) ⇒ 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.



56
57
58
59
60
61
# File 'lib/aws-sdk-core/plugins/checksum_algorithm.rb', line 56

def add_handlers(handlers, _config)
  handlers.add(OptionHandler, step: :initialize)
  # priority set low to ensure checksum is computed AFTER the request is
  # built but before it is signed
  handlers.add(ChecksumHandler, priority: 15, step: :build)
end