aws-sdk-core 3.84.0 → 3.85.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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/aws-sdk-core/log/formatter.rb +7 -1
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/aws-sdk-sts/customizations.rb +2 -0
- data/lib/aws-sdk-sts/presigner.rb +67 -0
- data/lib/seahorse/client/logging/formatter.rb +4 -2
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3b886138d094d6e84d381f1bb005b0eccf254f3a
|
|
4
|
+
data.tar.gz: 494272b4b2023250f4ce9d436b7e04b23f8e557f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8099062c26429ee165c039b5f8b82188bf4f775d1f7d51b6cc645a96d6d131278b467404411ad0fec901e0f8a099e084d9d9dc0736579232c4e2a997a89fef9f
|
|
7
|
+
data.tar.gz: 853ea7b6a336a90bff25edb5702a240e69e05d1b233bbb29ebd17a1da5ec27ece237444304b8753030f6ee47fd65f988ccd63ebabffd96318bb5bf1ee539c7d0
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.85.0
|
|
@@ -171,7 +171,13 @@ module Aws
|
|
|
171
171
|
end
|
|
172
172
|
|
|
173
173
|
def _http_response_body(response)
|
|
174
|
-
|
|
174
|
+
if response.context.http_response.body.respond_to?(:rewind)
|
|
175
|
+
@param_formatter.summarize(
|
|
176
|
+
response.context.http_response.body_contents
|
|
177
|
+
)
|
|
178
|
+
else
|
|
179
|
+
''
|
|
180
|
+
end
|
|
175
181
|
end
|
|
176
182
|
|
|
177
183
|
def _error_class(response)
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
require 'aws-sigv4'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module STS
|
|
5
|
+
# Allows you to create presigned URLs for STS operations.
|
|
6
|
+
#
|
|
7
|
+
# @example
|
|
8
|
+
#
|
|
9
|
+
# signer = Aws::STS::Presigner.new
|
|
10
|
+
# url = signer.get_caller_identity_presigned_url(
|
|
11
|
+
# headers: {"X-K8s-Aws-Id" => 'my-eks-cluster'}
|
|
12
|
+
# )
|
|
13
|
+
class Presigner
|
|
14
|
+
# @option options [Client] :client Optionally provide an existing
|
|
15
|
+
# STS client
|
|
16
|
+
def initialize(options = {})
|
|
17
|
+
@client = options[:client] || Aws::STS::Client.new
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Returns a presigned url for get_caller_identity.
|
|
21
|
+
#
|
|
22
|
+
# @option options [Hash] :headers
|
|
23
|
+
# Headers that should be signed and sent along with the request. All
|
|
24
|
+
# x-amz-* headers must be present during signing. Other headers are
|
|
25
|
+
# optional.
|
|
26
|
+
#
|
|
27
|
+
# @return [String] A presigned url string.
|
|
28
|
+
#
|
|
29
|
+
# @example
|
|
30
|
+
#
|
|
31
|
+
# url = signer.get_caller_identity_presigned_url(
|
|
32
|
+
# headers: {"X-K8s-Aws-Id" => 'my-eks-cluster'},
|
|
33
|
+
# )
|
|
34
|
+
#
|
|
35
|
+
# This can be easily converted to a token used by the EKS service:
|
|
36
|
+
# {https://ruby-doc.org/stdlib-2.3.1/libdoc/base64/rdoc/Base64.html#method-i-encode64}
|
|
37
|
+
# "k8s-aws-v1." + Base64.urlsafe_encode64(url).chomp("==")
|
|
38
|
+
def get_caller_identity_presigned_url(options = {})
|
|
39
|
+
req = @client.build_request(:get_session_token, {})
|
|
40
|
+
|
|
41
|
+
param_list = Aws::Query::ParamList.new
|
|
42
|
+
param_list.set('Action', 'GetCallerIdentity')
|
|
43
|
+
param_list.set('Version', req.context.config.api.version)
|
|
44
|
+
Aws::Query::EC2ParamBuilder.new(param_list)
|
|
45
|
+
.apply(req.context.operation.input, {})
|
|
46
|
+
|
|
47
|
+
signer = Aws::Sigv4::Signer.new(
|
|
48
|
+
service: 'sts',
|
|
49
|
+
region: req.context.config.region,
|
|
50
|
+
credentials_provider: req.context.config.credentials
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
url = Aws::Partitions::EndpointProvider.resolve(
|
|
54
|
+
req.context.config.region, 'sts', 'regional'
|
|
55
|
+
)
|
|
56
|
+
url += "/?#{param_list}"
|
|
57
|
+
|
|
58
|
+
signer.presign_url(
|
|
59
|
+
http_method: 'GET',
|
|
60
|
+
url: url,
|
|
61
|
+
body: '',
|
|
62
|
+
headers: options[:headers]
|
|
63
|
+
).to_s
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -173,9 +173,11 @@ module Seahorse
|
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
def _http_response_body(response)
|
|
176
|
-
response.context.http_response.body.respond_to?(:rewind)
|
|
177
|
-
summarize_value(response.context.http_response.body_contents)
|
|
176
|
+
if response.context.http_response.body.respond_to?(:rewind)
|
|
177
|
+
summarize_value(response.context.http_response.body_contents)
|
|
178
|
+
else
|
|
178
179
|
''
|
|
180
|
+
end
|
|
179
181
|
end
|
|
180
182
|
|
|
181
183
|
def _error_class(response)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aws-sdk-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.85.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Amazon Web Services
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-12-
|
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jmespath
|
|
@@ -222,6 +222,7 @@ files:
|
|
|
222
222
|
- lib/aws-sdk-sts/customizations.rb
|
|
223
223
|
- lib/aws-sdk-sts/errors.rb
|
|
224
224
|
- lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb
|
|
225
|
+
- lib/aws-sdk-sts/presigner.rb
|
|
225
226
|
- lib/aws-sdk-sts/resource.rb
|
|
226
227
|
- lib/aws-sdk-sts/types.rb
|
|
227
228
|
- lib/seahorse.rb
|