keycardai-oauth 0.11.3 → 0.11.4
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 +7 -0
- data/lib/keycardai/oauth/errors.rb +4 -1
- data/lib/keycardai/oauth/http.rb +2 -1
- data/lib/keycardai/oauth/metadata_retry.rb +7 -3
- data/lib/keycardai/oauth/version.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: a20f252dbd82d0937d4bdac24bdbe576187116b1d461bf3242e908fc90dacac8
|
|
4
|
+
data.tar.gz: 4b0a21509728dcec65cd2ce123a23b8b2a2414bc7ae948801c22ede55a8ebdd5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 613770b6603eb39aab91f67029a88f74de895e97f00fc22843ca2a5c6a5e66402ffea6f6b2b86be1fc97d9654d6ac661bd13b933b31395e68a9b3aa789e7a0ba
|
|
7
|
+
data.tar.gz: 649de559371625575cacbaf57351844bd7b010d337d898da8edd69fefb1414d31c03f484f20e6c9e70990ab2dcda40f216fbd2fe3fbb5e92b2b28fe3fedcaa4c
|
data/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,13 @@ the loopback flow (RFC 8252), JWT signing and verification with a caching JWKS
|
|
|
15
15
|
keyring, the three application credentials (ClientSecret with multi-zone,
|
|
16
16
|
WebIdentity, WorkloadIdentity with pluggable token sources), and AccessContext.
|
|
17
17
|
|
|
18
|
+
## 0.11.4-keycardai-oauth (2026-11-25)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
- fix(keycardai-oauth): pace oversized 5xx metadata responses (#92)
|
|
22
|
+
- Co-authored-by: devin-ai-keycard <devin-ai@keycard.ai>
|
|
23
|
+
Co-authored-by: Larry Osakwe <larry@keycard.ai>
|
|
24
|
+
|
|
18
25
|
## 0.11.3-keycardai-oauth (2026-11-25)
|
|
19
26
|
|
|
20
27
|
|
|
@@ -117,9 +117,12 @@ module Keycardai
|
|
|
117
117
|
class ResponseBodyTooLargeError < ProtocolError
|
|
118
118
|
# @return [Integer]
|
|
119
119
|
attr_reader :limit
|
|
120
|
+
# @return [String, nil]
|
|
121
|
+
attr_reader :retry_after
|
|
120
122
|
|
|
121
|
-
def initialize(status:, limit: MAX_RESPONSE_BODY_BYTES)
|
|
123
|
+
def initialize(status:, limit: MAX_RESPONSE_BODY_BYTES, retry_after: nil)
|
|
122
124
|
@limit = limit
|
|
125
|
+
@retry_after = retry_after
|
|
123
126
|
super("response body exceeded the #{limit}-byte decoded size limit (HTTP #{status})",
|
|
124
127
|
code: "invalid_response", status: status)
|
|
125
128
|
end
|
data/lib/keycardai/oauth/http.rb
CHANGED
|
@@ -179,7 +179,8 @@ module Keycardai
|
|
|
179
179
|
def check_limit(size, response, limit)
|
|
180
180
|
return if limit.nil? || size <= limit
|
|
181
181
|
|
|
182
|
-
raise ResponseBodyTooLargeError.new(status: response.code.to_i, limit: limit
|
|
182
|
+
raise ResponseBodyTooLargeError.new(status: response.code.to_i, limit: limit,
|
|
183
|
+
retry_after: response.get_fields("Retry-After")&.first)
|
|
183
184
|
end
|
|
184
185
|
end
|
|
185
186
|
private_constant :BoundedBodyReader
|
|
@@ -20,7 +20,11 @@ module Keycardai
|
|
|
20
20
|
return !(cause.is_a?(OpenSSL::SSL::SSLError) && cause.message.include?("certificate verify failed"))
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
response_error?(error) && (error.status == 429 || (500..599).cover?(error.status))
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.response_error?(error)
|
|
27
|
+
error.is_a?(HTTPError) || error.is_a?(ResponseBodyTooLargeError)
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
def initialize(clock, monotonic_clock: clock.equal?(WALL_CLOCK) ? MONOTONIC_CLOCK : clock)
|
|
@@ -88,11 +92,11 @@ module Keycardai
|
|
|
88
92
|
end
|
|
89
93
|
|
|
90
94
|
def throttled?(error)
|
|
91
|
-
|
|
95
|
+
self.class.response_error?(error) && error.status == 429
|
|
92
96
|
end
|
|
93
97
|
|
|
94
98
|
def retry_after(error)
|
|
95
|
-
return unless
|
|
99
|
+
return unless self.class.response_error?(error) && [429, 503].include?(error.status)
|
|
96
100
|
|
|
97
101
|
header = error.retry_after.to_s.strip
|
|
98
102
|
return [60, header.to_i].min if /\A[0-9]+\z/.match?(header)
|