Class: Aws::S3::Plugins::ARN::ARNHandler Private

Inherits:
Seahorse::Client::Handler
  • Object
show all
Defined in:
lib/aws-sdk-s3/plugins/arn.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 will extract out any ARN input and set context for other plugins to use without having to translate the ARN again.

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.


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/aws-sdk-s3/plugins/arn.rb', line 69

def call(context)
  bucket_member = _bucket_member(context.operation.input.shape)
  if bucket_member && (bucket = context.params[bucket_member])
    resolved_region, arn = ARN.resolve_arn!(
      bucket,
      context.config.region,
      context.config.s3_use_arn_region
    )
    if arn
      validate_config!(context, arn)

      fips = false
      if resolved_region.include?('fips')
        fips = true
        resolved_region = resolved_region.gsub('fips-', '')
                                         .gsub('-fips', '')
      end

      context.[:s3_arn] = {
        arn: arn,
        resolved_region: resolved_region,
        fips: fips,
        dualstack: extract_dualstack_config!(context)
      }
    end
  end
  @handler.call(context)
end