aws-sdk-core 3.21.3 → 3.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/aws-sdk-core/plugins/retry_errors.rb +47 -1
- data/lib/aws-sdk-core/shared_config.rb +11 -5
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54149f1832e91cbc45d96a83b677c5cf83d91dcc
|
4
|
+
data.tar.gz: 0ad04974faf3da443b6b5093ab3397de0b62f84c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 230cf3bb7ef5c247de6bb8b1f7363cae644d4869c415df572553ed1e4df3dd94465dd3768c037eca8b3d1bdf5d19bd3599df3ad850be7760a9f00637cd182645
|
7
|
+
data.tar.gz: af831a1819233e5d722acc8767e5148f73ba6e2e71ef08725daf98370cf6b73194d66f6f1d5826903e5c755c4a3facdee4549578b46e69344faa099ba43e0533
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.22.0
|
@@ -5,6 +5,29 @@ module Aws
|
|
5
5
|
# @api private
|
6
6
|
class RetryErrors < Seahorse::Client::Plugin
|
7
7
|
|
8
|
+
EQUAL_JITTER = lambda { |delay| (delay / 2) + Kernel.rand(0..(delay/2))}
|
9
|
+
FULL_JITTER= lambda { |delay| Kernel.rand(0..delay) }
|
10
|
+
NO_JITTER = lambda { |delay| delay }
|
11
|
+
|
12
|
+
JITTERS = {
|
13
|
+
none: NO_JITTER,
|
14
|
+
equal: EQUAL_JITTER,
|
15
|
+
full: FULL_JITTER
|
16
|
+
}
|
17
|
+
|
18
|
+
JITTERS.default_proc = lambda { |h,k|
|
19
|
+
raise KeyError, "#{k} is not a named jitter function. Must be one of #{h.keys}"
|
20
|
+
}
|
21
|
+
|
22
|
+
DEFAULT_BACKOFF = lambda do |c|
|
23
|
+
delay = 2 ** c.retries * c.config.retry_base_delay
|
24
|
+
delay = [delay, c.config.retry_max_delay].min if (c.config.retry_max_delay || 0) > 0
|
25
|
+
jitter = c.config.retry_jitter
|
26
|
+
jitter = JITTERS[jitter] if Symbol === jitter
|
27
|
+
delay = jitter.call(delay) if jitter
|
28
|
+
Kernel.sleep(delay)
|
29
|
+
end
|
30
|
+
|
8
31
|
option(:retry_limit,
|
9
32
|
default: 3,
|
10
33
|
doc_type: Integer,
|
@@ -16,7 +39,30 @@ checksum errors, networking errors, timeout errors and auth
|
|
16
39
|
errors from expired credentials.
|
17
40
|
DOCS
|
18
41
|
|
19
|
-
option(:
|
42
|
+
option(:retry_max_delay,
|
43
|
+
default: 0,
|
44
|
+
doc_type: Integer,
|
45
|
+
docstring: <<-DOCS)
|
46
|
+
The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
|
47
|
+
DOCS
|
48
|
+
|
49
|
+
option(:retry_base_delay,
|
50
|
+
default: 0.3,
|
51
|
+
doc_type: Float,
|
52
|
+
docstring: <<-DOCS)
|
53
|
+
The base delay in seconds used by the default backoff function.
|
54
|
+
DOCS
|
55
|
+
|
56
|
+
option(:retry_jitter,
|
57
|
+
default: :none,
|
58
|
+
doc_type: Symbol,
|
59
|
+
docstring: <<-DOCS)
|
60
|
+
A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
|
61
|
+
|
62
|
+
@see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
63
|
+
DOCS
|
64
|
+
|
65
|
+
option(:retry_backoff, DEFAULT_BACKOFF)
|
20
66
|
|
21
67
|
# @api private
|
22
68
|
class ErrorInspector
|
@@ -20,7 +20,11 @@ module Aws
|
|
20
20
|
# `~/.aws/credentials`) and the shared config file (the default path for
|
21
21
|
# which is `~/.aws/config`) are loaded. However, if you set the
|
22
22
|
# `ENV['AWS_SDK_CONFIG_OPT_OUT']` environment variable, only the shared
|
23
|
-
# credential file will be loaded.
|
23
|
+
# credential file will be loaded. You can specify the shared credential
|
24
|
+
# file path with the `ENV['AWS_SHARED_CREDENTIALS_FILE']` environment
|
25
|
+
# variable or with the `:credentials_path` option. Similarly, you can
|
26
|
+
# specify the shared config file path with the `ENV['AWS_CONFIG_FILE']`
|
27
|
+
# environment variable or with the `:config_path` option.
|
24
28
|
#
|
25
29
|
# The default profile name is 'default'. You can specify the profile name
|
26
30
|
# with the `ENV['AWS_PROFILE']` environment variable or with the
|
@@ -28,9 +32,11 @@ module Aws
|
|
28
32
|
#
|
29
33
|
# @param [Hash] options
|
30
34
|
# @option options [String] :credentials_path Path to the shared credentials
|
31
|
-
# file.
|
35
|
+
# file. If not specified, will check `ENV['AWS_SHARED_CREDENTIALS_FILE']`
|
36
|
+
# before using the default value of "#{Dir.home}/.aws/credentials".
|
32
37
|
# @option options [String] :config_path Path to the shared config file.
|
33
|
-
#
|
38
|
+
# If not specified, will check `ENV['AWS_CONFIG_FILE']` before using the
|
39
|
+
# default value of "#{Dir.home}/.aws/config".
|
34
40
|
# @option options [String] :profile_name The credential/config profile name
|
35
41
|
# to use. If not specified, will check `ENV['AWS_PROFILE']` before using
|
36
42
|
# the fixed default value of 'default'.
|
@@ -254,11 +260,11 @@ module Aws
|
|
254
260
|
end
|
255
261
|
|
256
262
|
def determine_credentials_path
|
257
|
-
default_shared_config_path('credentials')
|
263
|
+
ENV['AWS_SHARED_CREDENTIALS_FILE'] || default_shared_config_path('credentials')
|
258
264
|
end
|
259
265
|
|
260
266
|
def determine_config_path
|
261
|
-
default_shared_config_path('config')
|
267
|
+
ENV['AWS_CONFIG_FILE'] || default_shared_config_path('config')
|
262
268
|
end
|
263
269
|
|
264
270
|
def default_shared_config_path(file)
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -115,6 +115,14 @@ module Aws::STS
|
|
115
115
|
# Used when loading credentials from the shared credentials file
|
116
116
|
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
117
117
|
#
|
118
|
+
# @option options [Float] :retry_base_delay (0.3)
|
119
|
+
# The base delay in seconds used by the default backoff function.
|
120
|
+
#
|
121
|
+
# @option options [Symbol] :retry_jitter (:none)
|
122
|
+
# A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
|
123
|
+
#
|
124
|
+
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
125
|
+
#
|
118
126
|
# @option options [Integer] :retry_limit (3)
|
119
127
|
# The maximum number of times to retry failed requests. Only
|
120
128
|
# ~ 500 level server errors and certain ~ 400 level client errors
|
@@ -122,6 +130,9 @@ module Aws::STS
|
|
122
130
|
# checksum errors, networking errors, timeout errors and auth
|
123
131
|
# errors from expired credentials.
|
124
132
|
#
|
133
|
+
# @option options [Integer] :retry_max_delay (0)
|
134
|
+
# The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
|
135
|
+
#
|
125
136
|
# @option options [String] :secret_access_key
|
126
137
|
#
|
127
138
|
# @option options [String] :session_token
|
@@ -1475,7 +1486,7 @@ module Aws::STS
|
|
1475
1486
|
params: params,
|
1476
1487
|
config: config)
|
1477
1488
|
context[:gem_name] = 'aws-sdk-core'
|
1478
|
-
context[:gem_version] = '3.
|
1489
|
+
context[:gem_version] = '3.22.0'
|
1479
1490
|
Seahorse::Client::Request.new(handlers, context)
|
1480
1491
|
end
|
1481
1492
|
|
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.22.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: 2018-06-
|
11
|
+
date: 2018-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|