aws-sdk-core 3.241.0 → 3.241.1
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/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +28 -16
- data/lib/aws-sdk-signin/client.rb +1 -1
- data/lib/aws-sdk-signin.rb +1 -1
- data/lib/aws-sdk-sso/client.rb +1 -1
- data/lib/aws-sdk-sso.rb +1 -1
- data/lib/aws-sdk-ssooidc/client.rb +1 -1
- data/lib/aws-sdk-ssooidc.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/aws-sdk-sts.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c48d0632bd5c5e63a69c8688ee51b535b20eada9eaab757aad910a6482481eaa
|
|
4
|
+
data.tar.gz: 863c77cf8b07e9427043df1a8d37c2b7920518906eaf9c25951439e0f40ba1c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fb84da80b12823243e720171670cf15c55df4173460d159ead8f80ef93462d5b95fe7aad18458818d8f097c43972073adbfe4889bc8347a39a3a41e2266d57f7
|
|
7
|
+
data.tar.gz: 681a5d0046532c1a1ce3bd8df590ab5fab1e6154b99fd600bdc8e9cdcc7b50b023953efbcda59d2927ad314121be4e18da5f50edf25fe93019d483e3a9b1a78b
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.241.
|
|
1
|
+
3.241.1
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
module Aws
|
|
4
4
|
module Plugins
|
|
5
5
|
module Retries
|
|
6
|
-
|
|
7
6
|
# @api private
|
|
8
7
|
class ClockSkew
|
|
9
|
-
|
|
10
8
|
CLOCK_SKEW_THRESHOLD = 5 * 60 # five minutes
|
|
11
9
|
|
|
12
10
|
def initialize
|
|
@@ -22,9 +20,9 @@ module Aws
|
|
|
22
20
|
end
|
|
23
21
|
|
|
24
22
|
# Gets the clock_correction in seconds to apply to a given endpoint
|
|
25
|
-
# @param endpoint [URI
|
|
23
|
+
# @param endpoint [URI, String]
|
|
26
24
|
def clock_correction(endpoint)
|
|
27
|
-
@mutex.synchronize { @endpoint_clock_corrections[endpoint
|
|
25
|
+
@mutex.synchronize { @endpoint_clock_corrections[normalized_endpoint(endpoint)] }
|
|
28
26
|
end
|
|
29
27
|
|
|
30
28
|
# The estimated skew factors in any clock skew from
|
|
@@ -35,7 +33,7 @@ module Aws
|
|
|
35
33
|
# Estimated Skew should not be used to correct clock skew errors
|
|
36
34
|
# it should only be used to estimate TTL for a request
|
|
37
35
|
def estimated_skew(endpoint)
|
|
38
|
-
@mutex.synchronize { @endpoint_estimated_skews[endpoint
|
|
36
|
+
@mutex.synchronize { @endpoint_estimated_skews[normalized_endpoint(endpoint)] }
|
|
39
37
|
end
|
|
40
38
|
|
|
41
39
|
# Determines whether a request has clock skew by comparing
|
|
@@ -55,9 +53,9 @@ module Aws
|
|
|
55
53
|
endpoint = context.http_request.endpoint
|
|
56
54
|
now_utc = Time.now.utc
|
|
57
55
|
server_time = server_time(context.http_response)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
return unless server_time && (now_utc - server_time).abs > CLOCK_SKEW_THRESHOLD
|
|
57
|
+
|
|
58
|
+
set_clock_correction(normalized_endpoint(endpoint), server_time - now_utc)
|
|
61
59
|
end
|
|
62
60
|
|
|
63
61
|
# Called for every request
|
|
@@ -69,20 +67,35 @@ module Aws
|
|
|
69
67
|
now_utc = Time.now.utc
|
|
70
68
|
server_time = server_time(context.http_response)
|
|
71
69
|
return unless server_time
|
|
70
|
+
|
|
72
71
|
@mutex.synchronize do
|
|
73
|
-
@endpoint_estimated_skews[endpoint
|
|
72
|
+
@endpoint_estimated_skews[normalized_endpoint(endpoint)] = server_time - now_utc
|
|
74
73
|
end
|
|
75
74
|
end
|
|
76
75
|
|
|
77
76
|
private
|
|
78
77
|
|
|
78
|
+
##
|
|
79
|
+
# @param endpoint [URI, String]
|
|
80
|
+
# the endpoint to normalize
|
|
81
|
+
#
|
|
82
|
+
# @return [String]
|
|
83
|
+
# the endpoint's schema, host, and port - without any path or query arguments
|
|
84
|
+
def normalized_endpoint(endpoint)
|
|
85
|
+
uri = endpoint.is_a?(URI::Generic) ? endpoint : URI(endpoint.to_s)
|
|
86
|
+
|
|
87
|
+
return endpoint.to_s unless uri.scheme && uri.host
|
|
88
|
+
|
|
89
|
+
"#{uri.scheme}://#{uri.host}:#{uri.port}"
|
|
90
|
+
rescue URI::InvalidURIError
|
|
91
|
+
endpoint.to_s
|
|
92
|
+
end
|
|
93
|
+
|
|
79
94
|
# @param response [Seahorse::Client::Http::Response:]
|
|
80
95
|
def server_time(response)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
nil
|
|
85
|
-
end
|
|
96
|
+
Time.parse(response.headers['date']).utc
|
|
97
|
+
rescue StandardError
|
|
98
|
+
nil
|
|
86
99
|
end
|
|
87
100
|
|
|
88
101
|
# Sets the clock correction for an endpoint
|
|
@@ -90,11 +103,10 @@ module Aws
|
|
|
90
103
|
# @param correction [Number]
|
|
91
104
|
def set_clock_correction(endpoint, correction)
|
|
92
105
|
@mutex.synchronize do
|
|
93
|
-
@endpoint_clock_corrections[endpoint
|
|
106
|
+
@endpoint_clock_corrections[normalized_endpoint(endpoint)] = correction
|
|
94
107
|
end
|
|
95
108
|
end
|
|
96
109
|
end
|
|
97
110
|
end
|
|
98
111
|
end
|
|
99
112
|
end
|
|
100
|
-
|
data/lib/aws-sdk-signin.rb
CHANGED
data/lib/aws-sdk-sso/client.rb
CHANGED
data/lib/aws-sdk-sso.rb
CHANGED
data/lib/aws-sdk-ssooidc.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
data/lib/aws-sdk-sts.rb
CHANGED