class Aws::S3::Plugins::S3Signer
@api private
generic Sign plugin that uses endpoint auth scheme.
This plugin used to have a V4 signer but it was removed in favor of
def add_handlers(handlers, cfg)
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
def add_legacy_handler(handlers)
def add_legacy_handler(handlers) # generic Sign plugin will be skipped if it sees sigv2 handlers.add(LegacyHandler, step: :sign) end
def add_v4_handlers(handlers)
def add_v4_handlers(handlers) handlers.add(CachedBucketRegionHandler, step: :sign, priority: 60) handlers.add(BucketRegionErrorHandler, step: :sign, priority: 40) end
def custom_endpoint?(context)
def custom_endpoint?(context) region = context.config.region partition = Aws::Endpoints::Matchers.aws_partition(region) endpoint = context.http_request.endpoint !endpoint.hostname.include?(partition['dnsSuffix']) && !endpoint.hostname.include?(partition['dualStackDnsSuffix']) end
def new_hostname(context, region)
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