Class: Aws::S3::Plugins::S3Signer Private
- Inherits:
-
Seahorse::Client::Plugin
- Object
- Seahorse::Client::Plugin
- Aws::S3::Plugins::S3Signer
- 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 is an implementation detail and may be modified.
Defined Under Namespace
Classes: BucketRegionErrorHandler, CachedBucketRegionHandler, LegacyHandler, V4Handler
Class Method Summary collapse
Instance Method Summary collapse
- #add_handlers(handlers, cfg) ⇒ Object private
- #add_legacy_handler(handlers) ⇒ Object private
- #add_v4_handlers(handlers) ⇒ Object private
Class Method Details
.build_v4_signer(options = {}) ⇒ 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.
188 189 190 191 192 193 194 195 196 |
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 188 def build_v4_signer( = {}) Aws::Sigv4::Signer.new( service: 's3', region: [:region], credentials_provider: [:credentials], uri_escape_path: false, unsigned_headers: ['content-length', 'x-amzn-trace-id'] ) end |
.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.
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 198 def new_hostname(context, region) # Check to see if the bucket is actually an ARN and resolve it # Otherwise it will retry with the ARN as the bucket name. resolved_bucket, resolved_region, arn = BucketARN.resolve_arn!( context.params[:bucket], region, context.config.s3_use_arn_region ) uri = URI.parse( Aws::Partitions::EndpointProvider.resolve(resolved_region, 's3') ) if arn BucketARN.resolve_url!(uri, arn).host else resolved_bucket + '.' + uri.host end 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.
24 25 26 27 28 29 30 31 32 |
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 24 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.
40 41 42 |
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 40 def add_legacy_handler(handlers) 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.
34 35 36 37 38 |
# File 'lib/aws-sdk-s3/plugins/s3_signer.rb', line 34 def add_v4_handlers(handlers) handlers.add(CachedBucketRegionHandler, step: :sign, priority: 60) handlers.add(V4Handler, step: :sign) handlers.add(BucketRegionErrorHandler, step: :sign, priority: 40) end |