Class: Aws::S3::Plugins::S3Signer Private

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

Overview

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.

This plugin used to have a V4 signer but it was removed in favor of generic Sign plugin that uses endpoint auth scheme.

Defined Under Namespace

Classes: BucketRegionErrorHandler, CachedBucketRegionHandler, LegacyHandler

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new_hostname(context, region) ⇒ 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.



163
164
165
166
167
168
169
170
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 163

def new_hostname(context, region)
  endpoint_params = context[:endpoint_params].dup
  endpoint_params.region = region
  endpoint_params.endpoint = nil
  endpoint =
    context.config.endpoint_provider.resolve_endpoint(endpoint_params)
  URI(endpoint.url).host
end

Instance Method Details

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



15
16
17
18
19
20
21
22
23
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 15

def add_handlers(handlers, cfg)
  case cfg.signature_version
  when 'v4' then add_v4_handlers(handlers)
  when 's3' then add_legacy_handler(handlers)
  else
    msg = "unsupported signature version `#{cfg.signature_version}'"
    raise ArgumentError, msg
  end
end

#add_legacy_handler(handlers) ⇒ 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.



30
31
32
33
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 30

def add_legacy_handler(handlers)
  # generic Sign plugin will be skipped if it sees sigv2
  handlers.add(LegacyHandler, step: :sign)
end

#add_v4_handlers(handlers) ⇒ 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.



25
26
27
28
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 25

def add_v4_handlers(handlers)
  handlers.add(CachedBucketRegionHandler, step: :sign, priority: 60)
  handlers.add(BucketRegionErrorHandler, step: :sign, priority: 40)
end