entitlements-github-plugin 1.2.5 → 1.2.6
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/lib/entitlements/service/github.rb +22 -16
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e8b4641323dd4da38ecb87c7f94eacecdfc20508dfdeb0e1b02030c31fe67ab7
|
|
4
|
+
data.tar.gz: c9180370314b8e80b776ecc554fba1310cc690a246ddc1ac99509263dbb01547
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0311bcc81ebeac4a1ea1852962bf5a7b592771e2ed11ab1955e199bf5d935d5117e7632167d6bcda55d6b979167faa1cba79744282e55957e011975816b8417
|
|
7
|
+
data.tar.gz: 6de304801162205be96002493fedff35431cc37823fdc0b6f80933731fd89ae7ce15cf820be1a8e82dbb77a607e50a0900cba9604872566fac8b829d01c58fc2
|
|
@@ -392,23 +392,29 @@ module Entitlements
|
|
|
392
392
|
return { code: response.code.to_i, data: { "body" => response.body } }
|
|
393
393
|
end
|
|
394
394
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
return { code: 500, data: }
|
|
403
|
-
end
|
|
404
|
-
{ code: response.code.to_i, data: }
|
|
405
|
-
rescue JSON::ParserError => e
|
|
406
|
-
# JSON parse errors mean the API returned something we can't interpret. The
|
|
407
|
-
# synthesized 500 below triggers a retry, but the cause is more likely a real
|
|
408
|
-
# protocol/server problem than a transient network blip, so log at ERROR.
|
|
409
|
-
Entitlements.logger.error "#{e.class} #{e.message}: #{response.body.inspect}"
|
|
410
|
-
{ code: 500, data: { "body" => response.body } }
|
|
395
|
+
data = JSON.parse(response.body)
|
|
396
|
+
if data.key?("errors")
|
|
397
|
+
# Synthesized 500 below triggers a retry, so log at WARN. Note: some GraphQL
|
|
398
|
+
# `errors` are permanent (bad query, auth, schema). The retry wrapper's final
|
|
399
|
+
# "Giving up" ERROR will surface persistent cases.
|
|
400
|
+
Entitlements.logger.warn "Errors reported: #{data['errors'].inspect}"
|
|
401
|
+
return { code: 500, data: }
|
|
411
402
|
end
|
|
403
|
+
|
|
404
|
+
{ code: response.code.to_i, data: }
|
|
405
|
+
|
|
406
|
+
rescue Net::ReadTimeout => e
|
|
407
|
+
# Defend against network blips, those can be safely retried via the
|
|
408
|
+
# synthesized 500 below, so log at WARN.
|
|
409
|
+
reset_graphql_http
|
|
410
|
+
Entitlements.logger.warn "#{e.class} #{e.message}"
|
|
411
|
+
{ code: 500, data: nil }
|
|
412
|
+
rescue JSON::ParserError => e
|
|
413
|
+
# JSON parse errors mean the API returned something we can't interpret. The
|
|
414
|
+
# synthesized 500 below triggers a retry, but the cause is more likely a real
|
|
415
|
+
# protocol/server problem than a transient network blip, so log at ERROR.
|
|
416
|
+
Entitlements.logger.error "#{e.class} #{e.message}: #{response.body.inspect}"
|
|
417
|
+
{ code: 500, data: { "body" => response.body } }
|
|
412
418
|
rescue => e
|
|
413
419
|
# Catch-all for any unexpected exception (network blip OR local code bug).
|
|
414
420
|
# We retry below via the synthesized 500, but log at ERROR because this
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: entitlements-github-plugin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitHub, Inc. Security Ops
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: contracts
|