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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17549f9b27e4a7acc6b3eab8092b7bfb3d2c793d
4
- data.tar.gz: cd44be1ed3428eafcc7a094397122044f5f72a44
3
+ metadata.gz: 3b886138d094d6e84d381f1bb005b0eccf254f3a
4
+ data.tar.gz: 494272b4b2023250f4ce9d436b7e04b23f8e557f
5
5
  SHA512:
6
- metadata.gz: f364daaa16458966a796f51fd7b2089cc2acc06627d25c5ec7fba1b8d753dfe6e2748a7040842390c8709b11e1d2762c0013d6723366652cc35dc977e504fcb2
7
- data.tar.gz: 63b178cf3853e95b4d9910b61701001f97b6536c6d1154dd07be586e3e1941b2d1701c5ee7d7a60a7014456eec74764e5ec001c8e21a6bbb6d217bea26974c8e
6
+ metadata.gz: 8099062c26429ee165c039b5f8b82188bf4f775d1f7d51b6cc645a96d6d131278b467404411ad0fec901e0f8a099e084d9d9dc0736579232c4e2a997a89fef9f
7
+ data.tar.gz: 853ea7b6a336a90bff25edb5702a240e69e05d1b233bbb29ebd17a1da5ec27ece237444304b8753030f6ee47fd65f988ccd63ebabffd96318bb5bf1ee539c7d0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.84.0
1
+ 3.85.0
@@ -171,7 +171,13 @@ module Aws
171
171
  end
172
172
 
173
173
  def _http_response_body(response)
174
- @param_formatter.summarize(response.context.http_response.body_contents)
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)
@@ -40,6 +40,6 @@ require_relative 'aws-sdk-sts/customizations'
40
40
  # @service
41
41
  module Aws::STS
42
42
 
43
- GEM_VERSION = '3.84.0'
43
+ GEM_VERSION = '3.85.0'
44
44
 
45
45
  end
@@ -2101,7 +2101,7 @@ module Aws::STS
2101
2101
  params: params,
2102
2102
  config: config)
2103
2103
  context[:gem_name] = 'aws-sdk-core'
2104
- context[:gem_version] = '3.84.0'
2104
+ context[:gem_version] = '3.85.0'
2105
2105
  Seahorse::Client::Request.new(handlers, context)
2106
2106
  end
2107
2107
 
@@ -0,0 +1,2 @@
1
+ # utility classes
2
+ require 'aws-sdk-sts/presigner'
@@ -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.84.0
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-04 00:00:00.000000000 Z
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