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 +4 -4
- data/lib/aws/core/http/request.rb +7 -0
- data/lib/aws/core/query_request_builder.rb +1 -1
- data/lib/aws/ec2/client.rb +15 -7
- data/lib/aws/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52041f55d4c94a1749ea803fdde55eb508aa3135
|
4
|
+
data.tar.gz: 08a7efbe53cf9ffa5071c57fdc113ffd0c9c852b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:%
|
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"
|
data/lib/aws/ec2/client.rb
CHANGED
@@ -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
|
-
|
128
|
-
|
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
|
-
|
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