aws-sdk-core 3.108.0 → 3.110.0

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
  SHA256:
3
- metadata.gz: feeffc91d61810eb27a33a2df7e5b388faccd8818b48e97e6bba3bdc0eaeab38
4
- data.tar.gz: 973cb82585647b47b8736a2483b5b6bb3612541fc8e9096dc762c5d546340c3c
3
+ metadata.gz: 5d99d0d99ddc550900a970a6dc9732b2f4c3590bbf080941251f74dd1ca81f14
4
+ data.tar.gz: c99d3231552426bf0a12abf73a06296199918d20eadec98600968454bef4a9f8
5
5
  SHA512:
6
- metadata.gz: 9cd032fa393e37436ab9ee6e3c5aeae73f4bf707caa7481dfbe25c7ac90c7452a1061ca6888736ea1a91927f549bc83fd5c1b8bc52ff115727a6fde298268942
7
- data.tar.gz: 57be0eae50d215bc10c381a30e4c4e798365251701825b13969d9b7fb5a34a13cfedf0fc5391cb702bb2ef19f14da8cad5ebfeff03c7996dbb62ebb8701c79e9
6
+ metadata.gz: 8142f6e7ae0220d035dfc20af20553a3c2581acc729e939c52588434740ed71e0e28c0424aed8cd128d8621456fe53bc6cb903b6f21b4371dd737467da9bf8aa
7
+ data.tar.gz: 791e39ed9ad2e35b632b3493c28b3d5795235aea711b6fff5d7cd8c666cca5a1b196502cdaa0845e1c4dc5403d937479bc9c8849e018696e03217193bda95275
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.108.0
1
+ 3.110.0
@@ -75,5 +75,18 @@ module Aws
75
75
  def to_s
76
76
  "arn:#{partition}:#{service}:#{region}:#{account_id}:#{resource}"
77
77
  end
78
+
79
+ # Return the ARN as a hash
80
+ #
81
+ # @return [Hash]
82
+ def to_h
83
+ {
84
+ partition: @partition,
85
+ service: @service,
86
+ region: @region,
87
+ account_id: @account_id,
88
+ resource: @resource
89
+ }
90
+ end
78
91
  end
79
92
  end
@@ -16,10 +16,10 @@ module Aws
16
16
  # @param [Aws::Structure] data
17
17
  def initialize(context, message, data = Aws::EmptyStructure.new)
18
18
  @code = self.class.code
19
- @message = message if message && !message.empty?
20
19
  @context = context
21
20
  @data = data
22
- super(message)
21
+ @message = message && !message.empty? ? message : self.class
22
+ super(@message)
23
23
  end
24
24
 
25
25
  # @return [String]
@@ -2,14 +2,14 @@
2
2
 
3
3
  module Aws
4
4
  module Json
5
- class OjEngine
5
+ class JSONEngine
6
6
 
7
7
  def self.load(json)
8
- Oj.load(json)
8
+ JSON.load(json)
9
9
  end
10
10
 
11
11
  def self.dump(value)
12
- Oj.dump(value)
12
+ JSON.dump(value)
13
13
  end
14
14
 
15
15
  end
@@ -2,14 +2,14 @@
2
2
 
3
3
  module Aws
4
4
  module Json
5
- class JSONEngine
5
+ class OjEngine
6
6
 
7
7
  def self.load(json)
8
- JSON.load(json)
8
+ Oj.load(json)
9
9
  end
10
10
 
11
11
  def self.dump(value)
12
- JSON.dump(value)
12
+ Oj.dump(value)
13
13
  end
14
14
 
15
15
  end
@@ -49,8 +49,8 @@ module Aws
49
49
  module PageableResponse
50
50
 
51
51
  def self.extended(base)
52
- base.send(:extend, Enumerable)
53
- base.send(:extend, UnsafeEnumerableMethods)
52
+ base.extend Enumerable
53
+ base.extend UnsafeEnumerableMethods
54
54
  base.instance_variable_set("@last_page", nil)
55
55
  base.instance_variable_set("@more_results", nil)
56
56
  end
@@ -15,17 +15,18 @@ to default service endpoint when available.
15
15
  )
16
16
 
17
17
  def add_handlers(handlers, config)
18
- if config.regional_endpoint && !config.disable_host_prefix_injection
19
- handlers.add(Handler, priority: 90)
20
- end
18
+ handlers.add(Handler, priority: 10)
21
19
  end
22
20
 
23
21
  class Handler < Seahorse::Client::Handler
24
22
 
25
23
  def call(context)
26
- endpoint_trait = context.operation.endpoint_pattern
27
- if endpoint_trait && !endpoint_trait.empty?
28
- _apply_endpoint_trait(context, endpoint_trait)
24
+ if context.config.regional_endpoint &&
25
+ !context.config.disable_host_prefix_injection
26
+ endpoint_trait = context.operation.endpoint_pattern
27
+ if endpoint_trait && !endpoint_trait.empty?
28
+ _apply_endpoint_trait(context, endpoint_trait)
29
+ end
29
30
  end
30
31
  @handler.call(context)
31
32
  end
@@ -38,7 +38,7 @@ to test or custom endpoints. This should be a valid HTTP(S) URI.
38
38
  end
39
39
 
40
40
  # check region is a valid RFC host label
41
- unless cfg.region =~ /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{,63}(?<!-)$/
41
+ unless Seahorse::Util.host_label?(cfg.region)
42
42
  raise Errors::InvalidRegionError
43
43
  end
44
44
 
@@ -4,11 +4,11 @@ module Aws
4
4
  # An auto-refreshing credential provider that works by assuming a
5
5
  # role via {Aws::SSO::Client#get_role_credentials} using a cached access
6
6
  # token. This class does NOT implement the SSO login token flow - tokens
7
- # must generated and refreshed separately by running `aws login` with the
8
- # correct profile.
7
+ # must generated and refreshed separately by running `aws login` from the
8
+ # AWS CLI with the correct profile.
9
9
  #
10
10
  # For more background on AWS SSO see the official
11
- # [what is SSO](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html]
11
+ # {what is SSO}[https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html]
12
12
  # page.
13
13
  #
14
14
  # ## Refreshing Credentials from SSO
@@ -20,13 +20,29 @@ module Aws
20
20
  # and another token will be needed. The SDK does not manage refreshing of
21
21
  # the token value, but this can be done by running `aws login` with the
22
22
  # correct profile.
23
+ #
24
+ #
25
+ # # You must first run aws sso login --profile your-sso-profile
26
+ # sso_credentials = Aws::SSOCredentials.new(
27
+ # sso_account_id: '123456789',
28
+ # sso_role_name: "role_name",
29
+ # sso_region: "us-east-1",
30
+ # sso_start_url: 'https://your-start-url.awsapps.com/start'
31
+ # )
32
+ #
33
+ # ec2 = Aws::EC2::Client.new(credentials: sso_credentials)
34
+ #
35
+ # If you omit `:client` option, a new {SSO::Client} object will be
36
+ # constructed.
23
37
  class SSOCredentials
24
38
 
25
39
  include CredentialProvider
26
40
  include RefreshingCredentials
27
41
 
42
+ # @api private
28
43
  SSO_REQUIRED_OPTS = [:sso_account_id, :sso_region, :sso_role_name, :sso_start_url].freeze
29
44
 
45
+ # @api private
30
46
  SSO_LOGIN_GUIDANCE = 'The SSO session associated with this profile has '\
31
47
  'expired or is otherwise invalid. To refresh this SSO session run '\
32
48
  'aws sso login with the corresponding profile.'.freeze
@@ -45,7 +61,7 @@ module Aws
45
61
  # provided by the SSO service via the console and is the URL used to
46
62
  # login to the SSO directory. This is also sometimes referred to as
47
63
  # the "User Portal URL"
48
-
64
+ #
49
65
  # @option options [SSO::Client] :client Optional `SSO::Client`. If not
50
66
  # provided, a client will be constructed.
51
67
  def initialize(options = {})
@@ -65,11 +81,11 @@ module Aws
65
81
 
66
82
  options[:region] = @sso_region
67
83
  options[:credentials] = nil
68
- @client = options[:client] || SSO::Client.new(options)
84
+ @client = options[:client] || Aws::SSO::Client.new(options)
69
85
  super
70
86
  end
71
87
 
72
- # @return [STS::Client]
88
+ # @return [SSO::Client]
73
89
  attr_reader :client
74
90
 
75
91
  private
@@ -5,7 +5,7 @@ module Aws
5
5
  module Protocols
6
6
  class RestJson < Rest
7
7
 
8
- def body_for(_, _, rules, data)
8
+ def body_for(_a, _b, rules, data)
9
9
  if eventstream?(rules)
10
10
  encode_eventstream_response(rules, data, Aws::Json::Builder)
11
11
  else
@@ -5,8 +5,6 @@ module Aws
5
5
  module Protocols
6
6
  class RestXml < Rest
7
7
 
8
- include Seahorse::Model::Shapes
9
-
10
8
  def body_for(api, operation, rules, data)
11
9
  if eventstream?(rules)
12
10
  encode_eventstream_response(rules, data, Xml::Builder)
@@ -48,7 +48,7 @@ module Aws
48
48
  end
49
49
 
50
50
  def list(name, ref, values)
51
- if ref.shape.flattened
51
+ if ref[:flattened] || ref.shape.flattened
52
52
  values.each do |value|
53
53
  member(ref.shape.member.location_name || name, ref.shape.member, value)
54
54
  end
@@ -50,6 +50,6 @@ require_relative 'aws-sdk-sso/customizations'
50
50
  # @!group service
51
51
  module Aws::SSO
52
52
 
53
- GEM_VERSION = '3.108.0'
53
+ GEM_VERSION = '3.110.0'
54
54
 
55
55
  end
@@ -523,7 +523,7 @@ module Aws::SSO
523
523
  params: params,
524
524
  config: config)
525
525
  context[:gem_name] = 'aws-sdk-core'
526
- context[:gem_version] = '3.108.0'
526
+ context[:gem_version] = '3.110.0'
527
527
  Seahorse::Client::Request.new(handlers, context)
528
528
  end
529
529
 
@@ -8,6 +8,10 @@
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
10
10
 
11
+ unless Module.const_defined?(:Aws)
12
+ require 'aws-sdk-core'
13
+ require 'aws-sigv4'
14
+ end
11
15
 
12
16
  require_relative 'aws-sdk-sts/types'
13
17
  require_relative 'aws-sdk-sts/client_api'
@@ -46,6 +50,6 @@ require_relative 'aws-sdk-sts/customizations'
46
50
  # @!group service
47
51
  module Aws::STS
48
52
 
49
- GEM_VERSION = '3.108.0'
53
+ GEM_VERSION = '3.110.0'
50
54
 
51
55
  end
@@ -2204,7 +2204,7 @@ module Aws::STS
2204
2204
  params: params,
2205
2205
  config: config)
2206
2206
  context[:gem_name] = 'aws-sdk-core'
2207
- context[:gem_version] = '3.108.0'
2207
+ context[:gem_version] = '3.110.0'
2208
2208
  Seahorse::Client::Request.new(handlers, context)
2209
2209
  end
2210
2210
 
@@ -25,7 +25,8 @@ module Seahorse
25
25
  SocketError, EOFError, IOError, Timeout::Error,
26
26
  Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE,
27
27
  Errno::EINVAL, Errno::ETIMEDOUT, OpenSSL::SSL::SSLError,
28
- Errno::EHOSTUNREACH, Errno::ECONNREFUSED
28
+ Errno::EHOSTUNREACH, Errno::ECONNREFUSED,
29
+ Net::HTTPFatalError # for proxy connection failures
29
30
  ]
30
31
 
31
32
  # does not exist in Ruby 1.9.3
@@ -27,7 +27,6 @@ module Seahorse
27
27
  private
28
28
 
29
29
  def add_event_listeners(context, target)
30
- handler = self
31
30
  context.http_response.on_headers(200..299) do
32
31
  # In a fresh response body will be a StringIO
33
32
  # However, when a request is retried we may have
@@ -6,7 +6,6 @@ module Seahorse
6
6
  # @api private
7
7
  module Util
8
8
  class << self
9
-
10
9
  def uri_escape(string)
11
10
  CGI.escape(string.to_s.encode('UTF-8')).gsub('+', '%20').gsub('%7E', '~')
12
11
  end
@@ -15,6 +14,12 @@ module Seahorse
15
14
  path.gsub(/[^\/]+/) { |part| uri_escape(part) }
16
15
  end
17
16
 
17
+ # Checks for a valid host label
18
+ # @see https://tools.ietf.org/html/rfc3986#section-3.2.2
19
+ # @see https://tools.ietf.org/html/rfc1123#page-13
20
+ def host_label?(str)
21
+ str =~ /^(?!-)[a-zA-Z0-9-]{1,63}(?<!-)$/
22
+ end
18
23
  end
19
24
  end
20
25
  end
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.108.0
4
+ version: 3.110.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: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath