aws-sdk 1.43.0 → 1.43.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 171a745222bd1b0c0adb5a3d07bbf1cd8b2b894a
4
- data.tar.gz: c20ba74a7dc5fd4a860bd09a0936333dc0534a15
3
+ metadata.gz: 52041f55d4c94a1749ea803fdde55eb508aa3135
4
+ data.tar.gz: 08a7efbe53cf9ffa5071c57fdc113ffd0c9c852b
5
5
  SHA512:
6
- metadata.gz: 002f7402428e8a122e3a6236cb67c4d913834e797069cdb24f181ac75ed06a88d943744e34dbf951af8a8950c04501369e0e45a95eb21def87703c1dd1efd2cf
7
- data.tar.gz: bffbffad2b29a1ea748c5a66f07861d3f4f22eb83aa682cd13ca7e50acb561672776184d05e659541deb108627ba44b9d721210acac795e7a7579b1646a4e812
6
+ metadata.gz: a7be4c039a5e4013f6c15d0bceaab7e8cf14e49dbab7fdd079b21590a72f5f7b3155b0e091ca716c8d07cf79424e86410ad45f4f2df5ea9f2e51e4207dd382f7
7
+ data.tar.gz: 4ed7152201a0ee18c1a59aa2c8b1bbc0f6fe475c7c195f45b6af0ad2c1df937e0cca6ac6fa85e8f19a548c462c733e6aff5e0f084d51299fa0086d4172094674
@@ -138,6 +138,13 @@ module AWS
138
138
  end
139
139
  end
140
140
 
141
+ # @api private
142
+ def remove_param(name)
143
+ if param = @params.find { |p| p.name == name }
144
+ @params.delete(param)
145
+ end
146
+ end
147
+
141
148
  # @api private
142
149
  # @return [String,nil] Returns the url encoded request params. If there
143
150
  # are no params, then nil is returned.
@@ -25,7 +25,7 @@ module AWS
25
25
 
26
26
  def populate_request request, options
27
27
 
28
- now = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%SZ')
28
+ now = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S.%LZ')
29
29
 
30
30
  request.headers['Content-Type'] =
31
31
  "application/x-www-form-urlencoded; charset=utf-8"
@@ -121,26 +121,34 @@ module AWS
121
121
  private
122
122
 
123
123
  def presigned_copy_snapshot_url(params)
124
- now = Time.now.strftime("%Y%m%dT%H%M%SZ")
125
124
  token = credential_provider.session_token
126
125
 
127
- req = build_request(:copy_snapshot, params)
128
- req.headers['host'] = req.host
126
+ client = self.with_options(ec2_region: params[:source_region])
127
+
128
+ req = client.build_request(:copy_snapshot, params)
129
+
130
+ now = req.remove_param("Timestamp").value
131
+ now = Time.parse(now).strftime("%Y%m%dT%H%M%SZ")
129
132
 
130
133
  req.add_param("X-Amz-Algorithm", "AWS4-HMAC-SHA256")
131
134
  req.add_param("X-Amz-Date", now)
132
135
  req.add_param("X-Amz-SignedHeaders", 'host')
133
136
  req.add_param("X-Amz-Expires", "3600")
134
137
  req.add_param('X-Amz-Security-Token', token) if token
135
- req.add_param("X-Amz-Credential", v4_signer.credential(now))
138
+ req.add_param("X-Amz-Credential", client.v4_signer.credential(now))
136
139
 
137
140
  req.http_method = 'GET'
138
141
  req.uri = '/?' + req.url_encoded_params
139
142
  req.body = ''
143
+ req.headers.clear
144
+ req.headers['host'] = client.config.ec2_endpoint
145
+
146
+ key = client.v4_signer.derive_key(now)
147
+ sig = client.v4_signer.signature(req, key, now, client.v4_signer.class::EMPTY_DIGEST)
148
+
149
+ req.add_param('X-Amz-Signature', sig)
140
150
 
141
- key = v4_signer.derive_key(now)
142
- sig = v4_signer.signature(req, key, now, v4_signer.class::EMPTY_DIGEST)
143
- req.endpoint + req.uri + "&X-Amz-Signature=#{sig}"
151
+ req.endpoint + '/?' + req.url_encoded_params
144
152
  end
145
153
 
146
154
  end
data/lib/aws/version.rb CHANGED
@@ -13,5 +13,5 @@
13
13
 
14
14
  module AWS
15
15
  # Current version of the AWS SDK for Ruby
16
- VERSION = '1.43.0'
16
+ VERSION = '1.43.1'
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.43.0
4
+ version: 1.43.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services