fog-aws 3.19.0 → 3.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -1231
  3. data/README.md +1 -1
  4. data/fog-aws.gemspec +7 -4
  5. data/lib/fog/aws/auto_scaling.rb +1 -1
  6. data/lib/fog/aws/beanstalk.rb +1 -1
  7. data/lib/fog/aws/cdn.rb +1 -1
  8. data/lib/fog/aws/cloud_formation.rb +1 -1
  9. data/lib/fog/aws/cloud_watch.rb +1 -1
  10. data/lib/fog/aws/compute.rb +1 -1
  11. data/lib/fog/aws/credential_fetcher.rb +16 -2
  12. data/lib/fog/aws/data_pipeline.rb +1 -1
  13. data/lib/fog/aws/dns.rb +1 -1
  14. data/lib/fog/aws/dynamodb.rb +1 -1
  15. data/lib/fog/aws/ecs.rb +1 -1
  16. data/lib/fog/aws/elasticache.rb +2 -2
  17. data/lib/fog/aws/elb.rb +1 -1
  18. data/lib/fog/aws/elbv2.rb +1 -1
  19. data/lib/fog/aws/emr.rb +1 -1
  20. data/lib/fog/aws/glacier.rb +1 -1
  21. data/lib/fog/aws/iam.rb +1 -1
  22. data/lib/fog/aws/kinesis.rb +1 -1
  23. data/lib/fog/aws/kms.rb +6 -2
  24. data/lib/fog/aws/lambda.rb +1 -1
  25. data/lib/fog/aws/models/compute/dhcp_option.rb +1 -1
  26. data/lib/fog/aws/models/compute/flavors.rb +2008 -778
  27. data/lib/fog/aws/models/compute/network_interfaces.rb +1 -1
  28. data/lib/fog/aws/models/elasticache/cluster.rb +1 -1
  29. data/lib/fog/aws/models/storage/file.rb +4 -3
  30. data/lib/fog/aws/models/storage/files.rb +3 -2
  31. data/lib/fog/aws/parsers/compute/describe_instance_status.rb +5 -3
  32. data/lib/fog/aws/parsers/iam/list_server_certificates.rb +1 -1
  33. data/lib/fog/aws/parsers/kms/describe_key.rb +2 -2
  34. data/lib/fog/aws/parsers/kms/get_public_key.rb +30 -0
  35. data/lib/fog/aws/parsers/kms/schedule_key_deletion.rb +28 -0
  36. data/lib/fog/aws/parsers/kms/sign.rb +24 -0
  37. data/lib/fog/aws/parsers/rds/db_cluster_parser.rb +1 -1
  38. data/lib/fog/aws/parsers/rds/db_parser.rb +1 -1
  39. data/lib/fog/aws/parsers/rds/modify_db_subnet_group.rb +1 -1
  40. data/lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb +1 -1
  41. data/lib/fog/aws/parsers/storage/list_objects_v2.rb +66 -0
  42. data/lib/fog/aws/rds.rb +1 -1
  43. data/lib/fog/aws/redshift.rb +1 -1
  44. data/lib/fog/aws/requests/auto_scaling/attach_load_balancer_target_groups.rb +1 -1
  45. data/lib/fog/aws/requests/auto_scaling/describe_scaling_activities.rb +1 -1
  46. data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +1 -1
  47. data/lib/fog/aws/requests/cloud_formation/create_change_set.rb +1 -1
  48. data/lib/fog/aws/requests/cloud_formation/create_stack.rb +1 -1
  49. data/lib/fog/aws/requests/cloud_formation/get_template_summary.rb +1 -1
  50. data/lib/fog/aws/requests/cloud_formation/update_stack.rb +1 -1
  51. data/lib/fog/aws/requests/cloud_watch/list_metrics.rb +1 -1
  52. data/lib/fog/aws/requests/compute/authorize_security_group_egress.rb +1 -1
  53. data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +1 -1
  54. data/lib/fog/aws/requests/compute/create_network_interface.rb +1 -1
  55. data/lib/fog/aws/requests/compute/create_vpc.rb +1 -1
  56. data/lib/fog/aws/requests/compute/describe_network_interfaces.rb +2 -2
  57. data/lib/fog/aws/requests/compute/modify_network_interface_attribute.rb +1 -1
  58. data/lib/fog/aws/requests/compute/modify_volume.rb +1 -1
  59. data/lib/fog/aws/requests/compute/revoke_security_group_egress.rb +1 -1
  60. data/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +1 -1
  61. data/lib/fog/aws/requests/compute/run_instances.rb +2 -2
  62. data/lib/fog/aws/requests/data_pipeline/deactivate_pipeline.rb +1 -1
  63. data/lib/fog/aws/requests/ecs/list_task_definitions.rb +1 -1
  64. data/lib/fog/aws/requests/efs/create_file_system.rb +1 -1
  65. data/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb +1 -1
  66. data/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +2 -2
  67. data/lib/fog/aws/requests/elasticache/describe_engine_default_parameters.rb +1 -1
  68. data/lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb +1 -1
  69. data/lib/fog/aws/requests/elbv2/describe_tags.rb +2 -2
  70. data/lib/fog/aws/requests/glacier/initiate_job.rb +1 -1
  71. data/lib/fog/aws/requests/glacier/initiate_multipart_upload.rb +1 -1
  72. data/lib/fog/aws/requests/kinesis/list_streams.rb +1 -1
  73. data/lib/fog/aws/requests/kms/create_key.rb +74 -36
  74. data/lib/fog/aws/requests/kms/get_public_key.rb +35 -0
  75. data/lib/fog/aws/requests/kms/list_keys.rb +3 -4
  76. data/lib/fog/aws/requests/kms/schedule_key_deletion.rb +37 -0
  77. data/lib/fog/aws/requests/kms/sign.rb +62 -0
  78. data/lib/fog/aws/requests/rds/authorize_db_security_group_ingress.rb +2 -2
  79. data/lib/fog/aws/requests/rds/create_db_cluster.rb +1 -1
  80. data/lib/fog/aws/requests/rds/describe_db_snapshots.rb +1 -1
  81. data/lib/fog/aws/requests/rds/modify_db_instance.rb +1 -1
  82. data/lib/fog/aws/requests/rds/modify_db_parameter_group.rb +1 -1
  83. data/lib/fog/aws/requests/ses/send_raw_email.rb +1 -1
  84. data/lib/fog/aws/requests/sqs/change_message_visibility.rb +1 -1
  85. data/lib/fog/aws/requests/sqs/delete_message.rb +1 -1
  86. data/lib/fog/aws/requests/storage/copy_object.rb +2 -1
  87. data/lib/fog/aws/requests/storage/get_bucket.rb +2 -2
  88. data/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +2 -2
  89. data/lib/fog/aws/requests/storage/list_objects_v2.rb +129 -0
  90. data/lib/fog/aws/requests/storage/list_parts.rb +1 -1
  91. data/lib/fog/aws/requests/storage/post_object_restore.rb +24 -4
  92. data/lib/fog/aws/requests/storage/put_bucket.rb +0 -4
  93. data/lib/fog/aws/requests/storage/put_bucket_lifecycle.rb +1 -1
  94. data/lib/fog/aws/requests/storage/put_bucket_notification.rb +1 -1
  95. data/lib/fog/aws/requests/storage/put_object.rb +1 -1
  96. data/lib/fog/aws/requests/storage/sync_clock.rb +1 -1
  97. data/lib/fog/aws/requests/storage/upload_part_copy.rb +1 -1
  98. data/lib/fog/aws/ses.rb +20 -17
  99. data/lib/fog/aws/signaturev4.rb +1 -1
  100. data/lib/fog/aws/simpledb.rb +1 -1
  101. data/lib/fog/aws/sns.rb +1 -1
  102. data/lib/fog/aws/sqs.rb +1 -1
  103. data/lib/fog/aws/storage.rb +33 -9
  104. data/lib/fog/aws/support.rb +1 -1
  105. data/lib/fog/aws/version.rb +1 -1
  106. data/lib/fog/aws.rb +4 -1
  107. metadata +37 -11
@@ -6,7 +6,9 @@ module Fog
6
6
  #
7
7
  # @param bucket_name [String] Name of bucket containing object
8
8
  # @param object_name [String] Name of object to restore
9
- # @option days [Integer] Number of days to restore object for. Defaults to 100000 (a very long time)
9
+ # @param options [Hash] Optional parameters
10
+ # @option options [Integer] :days Number of days to restore object for. Defaults to 100000 (a very long time)
11
+ # @option options [String] :tier Glacier retrieval tier. Can be 'Standard', 'Bulk', or 'Expedited'
10
12
  #
11
13
  # @return [Excon::Response] response:
12
14
  # * status [Integer] 200 (OK) Object is previously restored
@@ -15,11 +17,24 @@ module Fog
15
17
  #
16
18
  # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPOSTrestore.html
17
19
  #
18
- def post_object_restore(bucket_name, object_name, days = 100000)
20
+ def post_object_restore(bucket_name, object_name, options = {})
19
21
  raise ArgumentError.new('bucket_name is required') unless bucket_name
20
22
  raise ArgumentError.new('object_name is required') unless object_name
21
23
 
22
- data = '<RestoreRequest xmlns="http://s3.amazonaws.com/doc/2006-3-01"><Days>' + days.to_s + '</Days></RestoreRequest>'
24
+ unless options.is_a?(Hash)
25
+ Fog::Logger.deprecation("post_object_restore with a bare days parameter is deprecated, use post_object_restore(bucket_name, object_name, :days => days) instead [light_black](#{caller.first})[/]")
26
+ options = { :days => options }
27
+ end
28
+
29
+ days = options[:days] || 100000
30
+ tier = options[:tier]
31
+
32
+ data = '<RestoreRequest xmlns="http://s3.amazonaws.com/doc/2006-03-01/">'
33
+ data += '<Days>' + days.to_s + '</Days>'
34
+ if tier
35
+ data += '<GlacierJobParameters><Tier>' + tier + '</Tier></GlacierJobParameters>'
36
+ end
37
+ data += '</RestoreRequest>'
23
38
 
24
39
  headers = {}
25
40
  headers['Content-MD5'] = Base64.encode64(OpenSSL::Digest::MD5.digest(data)).strip
@@ -39,7 +54,12 @@ module Fog
39
54
  end
40
55
 
41
56
  class Mock # :nodoc:all
42
- def post_object_restore(bucket_name, object_name, days = 100000)
57
+ def post_object_restore(bucket_name, object_name, options = {})
58
+ unless options.is_a?(Hash)
59
+ Fog::Logger.deprecation("post_object_restore with a bare days parameter is deprecated, use post_object_restore(bucket_name, object_name, :days => days) instead [light_black](#{caller.first})[/]")
60
+ options = { :days => options }
61
+ end
62
+
43
63
  response = get_object(bucket_name, object_name)
44
64
  response.body = nil
45
65
  response
@@ -61,10 +61,6 @@ DATA
61
61
  end
62
62
  if !self.data[:buckets][bucket_name]
63
63
  self.data[:buckets][bucket_name] = bucket
64
- elsif self.region != 'us-east-1'
65
- response.status = 409
66
- Fog::Logger.warning "Your region '#{self.region}' does not match the default region 'us-east-1'"
67
- raise(Excon::Errors.status_error({:expects => 201}, response))
68
64
  end
69
65
  response
70
66
  end
@@ -47,7 +47,7 @@ module Fog
47
47
  if rule['NoncurrentVersionExpiration']['NoncurrentDays']
48
48
  NoncurrentVersionExpiration { NoncurrentDays rule['NoncurrentVersionExpiration']['NoncurrentDays'] }
49
49
  elsif rule['NoncurrentVersionExpiration']['Date']
50
- NoncurrentVersoinExpiration {
50
+ NoncurrentVersionExpiration {
51
51
  if Date rule['NoncurrentVersionExpiration']['Date'].is_a?(Time)
52
52
  rule['NoncurrentVersionExpiration']['Date'].utc.iso8601
53
53
  else
@@ -5,7 +5,7 @@ module Fog
5
5
  # Change notification configuration for an S3 bucket
6
6
  #
7
7
  # @param bucket_name [String] name of bucket to set notification configuration for
8
- # * notications [Hash]:
8
+ # * notifications [Hash]:
9
9
  # * Topics [Array] SNS topic configurations for the notification
10
10
  # * ID [String] Unique identifier for the configuration
11
11
  # * Topic [String] Amazon SNS topic ARN to which Amazon S3 will publish a message when it detects events of specified type
@@ -16,7 +16,7 @@ module Fog
16
16
  # @option options Content-Type [String] Standard MIME type describing contents (defaults to MIME::Types.of.first)
17
17
  # @option options Expires [String] Cache expiry
18
18
  # @option options x-amz-acl [String] Permissions, must be in ['private', 'public-read', 'public-read-write', 'authenticated-read']
19
- # @option options x-amz-storage-class [String] Default is 'STANDARD', set to 'REDUCED_REDUNDANCY' for non-critical, reproducable data
19
+ # @option options x-amz-storage-class [String] Default is 'STANDARD', set to 'REDUCED_REDUNDANCY' for non-critical, reproducible data
20
20
  # @option options x-amz-meta-#{name} Headers to be returned with object, note total size of request without body must be less than 8 KB. Each name, value pair must conform to US-ASCII.
21
21
  # @option options x-amz-server-side-encryption [String] Sets HTTP header for server-side encryption. Set to 'AES256' for SSE-S3 and SSE-C. Set to 'aws:kms' for SSE-KMS
22
22
  # @option options x-amz-server-side​-encryption​-customer-algorithm [String] Algorithm to use to when encrypting the object for SSE-C.
@@ -18,7 +18,7 @@ module Fog
18
18
  def sync_clock_url
19
19
  host = @acceleration ? region_to_host(@region) : @host
20
20
 
21
- "#{@scheme}://#{host}"
21
+ "#{@scheme}://#{host}:#{@port}"
22
22
  end
23
23
  end # Real
24
24
 
@@ -35,7 +35,7 @@ module Fog
35
35
  # @option options [Time] x-amz-copy_source-if-modified_since Copies object it it has been modified since this time
36
36
  # @option options [String] x-amz-copy_source-if-none-match Copies object if its etag does not match this value
37
37
  # @option options [Time] x-amz-copy_source-if-unmodified-since Copies object it it has not been modified since this time
38
- # @option options [Time] x-amz-copy-source-range Specifes the range of bytes to copy from the source object
38
+ # @option options [Time] x-amz-copy-source-range Specifies the range of bytes to copy from the source object
39
39
  #
40
40
  # @return [Excon::Response]
41
41
  # * body [Hash]:
data/lib/fog/aws/ses.rb CHANGED
@@ -7,7 +7,7 @@ module Fog
7
7
  class MessageRejected < Fog::Errors::Error; end
8
8
 
9
9
  requires :aws_access_key_id, :aws_secret_access_key
10
- recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
10
+ recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
11
11
 
12
12
  request_path 'fog/aws/requests/ses'
13
13
  request :delete_verified_email_address
@@ -48,18 +48,21 @@ module Fog
48
48
  def initialize(options={})
49
49
 
50
50
  @use_iam_profile = options[:use_iam_profile]
51
- setup_credentials(options)
52
51
 
53
52
  @instrumentor = options[:instrumentor]
54
53
  @instrumentor_name = options[:instrumentor_name] || 'fog.aws.ses'
55
54
  @connection_options = options[:connection_options] || {}
56
55
  options[:region] ||= 'us-east-1'
56
+ @region = options[:region]
57
+
57
58
  @host = options[:host] || "email.#{options[:region]}.amazonaws.com"
58
59
  @path = options[:path] || '/'
59
60
  @persistent = options[:persistent] || false
60
61
  @port = options[:port] || 443
61
62
  @scheme = options[:scheme] || 'https'
62
63
  @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
64
+
65
+ setup_credentials(options)
63
66
  end
64
67
 
65
68
  def reload
@@ -74,7 +77,7 @@ module Fog
74
77
  @aws_session_token = options[:aws_session_token]
75
78
  @aws_credentials_expire_at = options[:aws_credentials_expire_at]
76
79
 
77
- @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
80
+ @signer = Fog::AWS::SignatureV4.new(@aws_access_key_id, @aws_secret_access_key, @region, 'ses')
78
81
  end
79
82
 
80
83
  def request(params)
@@ -87,20 +90,20 @@ module Fog
87
90
  'Content-Type' => 'application/x-www-form-urlencoded',
88
91
  'Date' => Fog::Time.now.to_date_header,
89
92
  }
90
- headers['x-amz-security-token'] = @aws_session_token if @aws_session_token
91
- #AWS3-HTTPS AWSAccessKeyId=<Your AWS Access Key ID>, Algorithm=HmacSHA256, Signature=<Signature>
92
- headers['X-Amzn-Authorization'] = 'AWS3-HTTPS '
93
- headers['X-Amzn-Authorization'] << 'AWSAccessKeyId=' << @aws_access_key_id
94
- headers['X-Amzn-Authorization'] << ', Algorithm=HmacSHA256'
95
- headers['X-Amzn-Authorization'] << ', Signature=' << Base64.encode64(@hmac.sign(headers['Date'])).chomp!
96
-
97
- body = ''
98
- for key in params.keys.sort
99
- unless (value = params[key]).nil?
100
- body << "#{key}=#{CGI.escape(value.to_s).gsub(/\+/, '%20')}&"
101
- end
102
- end
103
- body.chop! # remove trailing '&'
93
+
94
+ body, headers = AWS.signed_params_v4(
95
+ params,
96
+ { 'Content-Type' => 'application/x-www-form-urlencoded' },
97
+ {
98
+ :method => 'POST',
99
+ :aws_session_token => @aws_session_token,
100
+ :signer => @signer,
101
+ :host => @host,
102
+ :path => @path,
103
+ :port => @port,
104
+ :version => '2010-12-01'
105
+ }
106
+ )
104
107
 
105
108
  if @instrumentor
106
109
  @instrumentor.instrument("#{@instrumentor_name}.request", params) do
@@ -106,7 +106,7 @@ DATA
106
106
  end
107
107
 
108
108
  def canonical_headers(headers)
109
- canonical_headers = ''
109
+ canonical_headers = +''
110
110
 
111
111
  for key in headers.keys.sort_by {|k| k.to_s.downcase}
112
112
  canonical_headers << "#{key.to_s.downcase}:#{headers[key].to_s.strip}\n"
@@ -4,7 +4,7 @@ module Fog
4
4
  extend Fog::AWS::CredentialFetcher::ServiceMethods
5
5
 
6
6
  requires :aws_access_key_id, :aws_secret_access_key
7
- recognizes :host, :nil_string, :path, :port, :scheme, :persistent, :region, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
7
+ recognizes :host, :nil_string, :path, :port, :scheme, :persistent, :region, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
8
8
 
9
9
  request_path 'fog/aws/requests/simpledb'
10
10
  request :batch_put_attributes
data/lib/fog/aws/sns.rb CHANGED
@@ -4,7 +4,7 @@ module Fog
4
4
  extend Fog::AWS::CredentialFetcher::ServiceMethods
5
5
 
6
6
  requires :aws_access_key_id, :aws_secret_access_key
7
- recognizes :host, :path, :port, :scheme, :persistent, :region, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
7
+ recognizes :host, :path, :port, :scheme, :persistent, :region, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
8
8
 
9
9
  request_path 'fog/aws/requests/sns'
10
10
  request :add_permission
data/lib/fog/aws/sqs.rb CHANGED
@@ -4,7 +4,7 @@ module Fog
4
4
  extend Fog::AWS::CredentialFetcher::ServiceMethods
5
5
 
6
6
  requires :aws_access_key_id, :aws_secret_access_key
7
- recognizes :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
7
+ recognizes :region, :host, :path, :port, :scheme, :persistent, :aws_session_token, :use_iam_profile, :aws_credentials_expire_at, :instrumentor, :instrumentor_name, :sts_endpoint
8
8
 
9
9
  request_path 'fog/aws/requests/sqs'
10
10
  request :change_message_visibility
@@ -7,6 +7,8 @@ module Fog
7
7
 
8
8
  DEFAULT_REGION = 'us-east-1'
9
9
  ACCELERATION_HOST = 's3-accelerate.amazonaws.com'
10
+ AWS_FIPS_REGIONS = %w(us-east-1 us-east-2 us-west-1 us-west-2 us-gov-east-1 us-gov-west-1 ca-central-1 ca-west-1).freeze
11
+ AWS_GOVCLOUD_REGIONS = %w(us-gov-east-1 us-gov-west-1).freeze
10
12
 
11
13
  DEFAULT_SCHEME = 'https'
12
14
  DEFAULT_SCHEME_PORT = {
@@ -14,14 +16,22 @@ module Fog
14
16
  'https' => 443
15
17
  }
16
18
 
19
+ DEFAULT_CONNECTION_OPTIONS = {
20
+ retry_limit: 5,
21
+ retry_interval: 1
22
+ }
23
+
17
24
  MIN_MULTIPART_CHUNK_SIZE = 5242880
18
25
  MAX_SINGLE_PUT_SIZE = 5368709120
19
26
 
20
27
  VALID_QUERY_KEYS = %w[
21
28
  acl
29
+ continuation-token
22
30
  cors
23
31
  delete
32
+ fetch-owner
24
33
  lifecycle
34
+ list-type
25
35
  location
26
36
  logging
27
37
  notification
@@ -35,6 +45,7 @@ module Fog
35
45
  response-content-type
36
46
  response-expires
37
47
  restore
48
+ start-after
38
49
  tagging
39
50
  torrent
40
51
  uploadId
@@ -46,7 +57,7 @@ module Fog
46
57
  ]
47
58
 
48
59
  requires :aws_access_key_id, :aws_secret_access_key
49
- recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname, :max_put_chunk_size, :max_copy_chunk_size, :aws_credentials_refresh_threshold_seconds, :disable_content_md5_validation
60
+ recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname, :max_put_chunk_size, :max_copy_chunk_size, :aws_credentials_refresh_threshold_seconds, :disable_content_md5_validation, :sts_endpoint
50
61
 
51
62
  secrets :aws_secret_access_key, :hmac
52
63
 
@@ -95,6 +106,7 @@ module Fog
95
106
  request :head_object_url
96
107
  request :initiate_multipart_upload
97
108
  request :list_multipart_uploads
109
+ request :list_objects_v2
98
110
  request :list_parts
99
111
  request :post_object_hidden_fields
100
112
  request :post_object_restore
@@ -253,13 +265,17 @@ module Fog
253
265
  end
254
266
 
255
267
  def region_to_host(region=nil)
256
- case region.to_s
257
- when DEFAULT_REGION, ''
258
- 's3.amazonaws.com'
259
- when %r{\Acn-.*}
260
- "s3.#{region}.amazonaws.com.cn"
268
+ if ENV['AWS_USE_FIPS_ENDPOINT'] == 'true' && AWS_FIPS_REGIONS.include?(region)
269
+ "s3-fips.#{region}.amazonaws.com" # https://aws.amazon.com/compliance/fips/
261
270
  else
262
- "s3.#{region}.amazonaws.com"
271
+ case region.to_s
272
+ when DEFAULT_REGION, ''
273
+ 's3.amazonaws.com'
274
+ when %r{\Acn-.*}
275
+ "s3.#{region}.amazonaws.com.cn"
276
+ else
277
+ "s3.#{region}.amazonaws.com"
278
+ end
263
279
  end
264
280
  end
265
281
 
@@ -546,11 +562,12 @@ module Fog
546
562
  @use_iam_profile = options[:use_iam_profile]
547
563
  @instrumentor = options[:instrumentor]
548
564
  @instrumentor_name = options[:instrumentor_name] || 'fog.aws.storage'
549
- @connection_options = options[:connection_options] || { retry_limit: 5, retry_interval: 1 }
565
+ @connection_options =
566
+ DEFAULT_CONNECTION_OPTIONS.merge(options[:connection_options] || {})
550
567
  @persistent = options.fetch(:persistent, false)
551
568
  @acceleration = options.fetch(:acceleration, false)
552
569
  @signature_version = options.fetch(:aws_signature_version, 4)
553
- @enable_signature_v4_streaming = options.fetch(:enable_signature_v4_streaming, true)
570
+ @enable_signature_v4_streaming = options.fetch(:enable_signature_v4_streaming, false)
554
571
  validate_signature_version!
555
572
  @path_style = options[:path_style] || false
556
573
 
@@ -572,6 +589,13 @@ module Fog
572
589
  @port = options[:port] || DEFAULT_SCHEME_PORT[@scheme]
573
590
  end
574
591
 
592
+ # GovCloud doesn't support S3 Transfer Acceleration https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-s3.html
593
+ # S3 Transfer Acceleration doesn't support FIPS endpoints. When both fog_aws_accelerate=true and AWS_USE_FIPS_ENDPOINT=true, don't use Accelerate.
594
+ if @acceleration && (AWS_GOVCLOUD_REGIONS.include?(@region) || ENV['AWS_USE_FIPS_ENDPOINT'] == 'true')
595
+ Fog::Logger.warning("fog: S3 Transfer Acceleration is not available in GovCloud regions or when AWS_USE_FIPS_ENDPOINT=true. Disabling acceleration.")
596
+ @acceleration = false
597
+ end
598
+
575
599
  @host = ACCELERATION_HOST if @acceleration
576
600
  setup_credentials(options)
577
601
  end
@@ -4,7 +4,7 @@ module Fog
4
4
  extend Fog::AWS::CredentialFetcher::ServiceMethods
5
5
 
6
6
  requires :aws_access_key_id, :aws_secret_access_key
7
- recognizes :host, :path, :port, :scheme, :instrumentor, :instrumentor_name, :region, :persistent, :aws_session_token
7
+ recognizes :host, :path, :port, :scheme, :instrumentor, :instrumentor_name, :region, :persistent, :aws_session_token, :aws_credentials_expire_at, :sts_endpoint
8
8
 
9
9
  model_path 'fog/aws/models/support'
10
10
  request_path 'fog/aws/requests/support'
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "3.19.0"
3
+ VERSION = '3.33.0'.freeze
4
4
  end
5
5
  end
data/lib/fog/aws.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'base64'
1
2
  require 'fog/core'
2
3
  require 'fog/xml'
3
4
  require 'fog/json'
@@ -226,12 +227,14 @@ module Fog
226
227
  'ap-south-1',
227
228
  'ap-southeast-1', 'ap-southeast-2', 'ap-southeast-3', 'ap-southeast-4',
228
229
  'ca-central-1',
230
+ 'ca-west-1',
229
231
  'cn-north-1',
230
232
  'cn-northwest-1',
231
233
  'eu-central-1',
232
234
  'eu-north-1',
233
235
  'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-south-1', 'eu-south-2',
234
- 'me-south-1','me-central-1',
236
+ 'il-central-1',
237
+ 'me-south-1', 'me-central-1',
235
238
  'us-east-1', 'us-east-2',
236
239
  'us-west-1', 'us-west-2',
237
240
  'sa-east-1',
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.19.0
4
+ version: 3.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
8
8
  - Wesley Beary
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2023-05-18 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
@@ -59,14 +58,14 @@ dependencies:
59
58
  requirements:
60
59
  - - "~>"
61
60
  - !ruby/object:Gem::Version
62
- version: 2.3.0
61
+ version: 3.0.0
63
62
  type: :development
64
63
  prerelease: false
65
64
  version_requirements: !ruby/object:Gem::Requirement
66
65
  requirements:
67
66
  - - "~>"
68
67
  - !ruby/object:Gem::Version
69
- version: 2.3.0
68
+ version: 3.0.0
70
69
  - !ruby/object:Gem::Dependency
71
70
  name: shindo
72
71
  requirement: !ruby/object:Gem::Requirement
@@ -81,20 +80,40 @@ dependencies:
81
80
  - - "~>"
82
81
  - !ruby/object:Gem::Version
83
82
  version: '0.3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: base64
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0.2'
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '0.4'
93
+ type: :runtime
94
+ prerelease: false
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0.2'
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.4'
84
103
  - !ruby/object:Gem::Dependency
85
104
  name: fog-core
86
105
  requirement: !ruby/object:Gem::Requirement
87
106
  requirements:
88
107
  - - "~>"
89
108
  - !ruby/object:Gem::Version
90
- version: '2.1'
109
+ version: '2.6'
91
110
  type: :runtime
92
111
  prerelease: false
93
112
  version_requirements: !ruby/object:Gem::Requirement
94
113
  requirements:
95
114
  - - "~>"
96
115
  - !ruby/object:Gem::Version
97
- version: '2.1'
116
+ version: '2.6'
98
117
  - !ruby/object:Gem::Dependency
99
118
  name: fog-json
100
119
  requirement: !ruby/object:Gem::Requirement
@@ -600,7 +619,10 @@ files:
600
619
  - lib/fog/aws/parsers/iam/upload_server_certificate.rb
601
620
  - lib/fog/aws/parsers/iam/upload_signing_certificate.rb
602
621
  - lib/fog/aws/parsers/kms/describe_key.rb
622
+ - lib/fog/aws/parsers/kms/get_public_key.rb
603
623
  - lib/fog/aws/parsers/kms/list_keys.rb
624
+ - lib/fog/aws/parsers/kms/schedule_key_deletion.rb
625
+ - lib/fog/aws/parsers/kms/sign.rb
604
626
  - lib/fog/aws/parsers/lambda/base.rb
605
627
  - lib/fog/aws/parsers/rds/authorize_db_security_group_ingress.rb
606
628
  - lib/fog/aws/parsers/rds/base.rb
@@ -731,6 +753,7 @@ files:
731
753
  - lib/fog/aws/parsers/storage/get_service.rb
732
754
  - lib/fog/aws/parsers/storage/initiate_multipart_upload.rb
733
755
  - lib/fog/aws/parsers/storage/list_multipart_uploads.rb
756
+ - lib/fog/aws/parsers/storage/list_objects_v2.rb
734
757
  - lib/fog/aws/parsers/storage/list_parts.rb
735
758
  - lib/fog/aws/parsers/storage/upload_part_copy_object.rb
736
759
  - lib/fog/aws/parsers/sts/assume_role.rb
@@ -1222,7 +1245,10 @@ files:
1222
1245
  - lib/fog/aws/requests/kinesis/split_shard.rb
1223
1246
  - lib/fog/aws/requests/kms/create_key.rb
1224
1247
  - lib/fog/aws/requests/kms/describe_key.rb
1248
+ - lib/fog/aws/requests/kms/get_public_key.rb
1225
1249
  - lib/fog/aws/requests/kms/list_keys.rb
1250
+ - lib/fog/aws/requests/kms/schedule_key_deletion.rb
1251
+ - lib/fog/aws/requests/kms/sign.rb
1226
1252
  - lib/fog/aws/requests/lambda/add_permission.rb
1227
1253
  - lib/fog/aws/requests/lambda/create_event_source_mapping.rb
1228
1254
  - lib/fog/aws/requests/lambda/create_function.rb
@@ -1400,6 +1426,7 @@ files:
1400
1426
  - lib/fog/aws/requests/storage/head_object_url.rb
1401
1427
  - lib/fog/aws/requests/storage/initiate_multipart_upload.rb
1402
1428
  - lib/fog/aws/requests/storage/list_multipart_uploads.rb
1429
+ - lib/fog/aws/requests/storage/list_objects_v2.rb
1403
1430
  - lib/fog/aws/requests/storage/list_parts.rb
1404
1431
  - lib/fog/aws/requests/storage/post_object_hidden_fields.rb
1405
1432
  - lib/fog/aws/requests/storage/post_object_restore.rb
@@ -1442,8 +1469,8 @@ files:
1442
1469
  homepage: https://github.com/fog/fog-aws
1443
1470
  licenses:
1444
1471
  - MIT
1445
- metadata: {}
1446
- post_install_message:
1472
+ metadata:
1473
+ changelog_uri: https://github.com/fog/fog-aws/blob/master/CHANGELOG.md
1447
1474
  rdoc_options: []
1448
1475
  require_paths:
1449
1476
  - lib
@@ -1458,8 +1485,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1458
1485
  - !ruby/object:Gem::Version
1459
1486
  version: '0'
1460
1487
  requirements: []
1461
- rubygems_version: 3.4.13
1462
- signing_key:
1488
+ rubygems_version: 3.7.1
1463
1489
  specification_version: 4
1464
1490
  summary: Module for the 'fog' gem to support Amazon Web Services.
1465
1491
  test_files: []