cb-api 17.2.0 → 17.3.0
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 +1 -0
- data/lib/cb/utils/validator.rb +5 -1
- data/lib/cb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa8e3cd1a0b1dcc5ae4ee02097d1b7b9bb124956
|
4
|
+
data.tar.gz: 756ebb65276e94919991643e6a8ff731cb9a4443
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff9ba223b51017dc29f98a7004dc813be2ab55ccdec9ef97ff9d3fce28eafc14cc1199ba297520b527ccdba435e809f08aa6498306b9b02f5c57fe82bacc8a43
|
7
|
+
data.tar.gz: 3da61a8455907388a9f341c81c5552859c0eeafbc8c20b5c7661c5643983413c73e6b67e910b9153dfbc2d1955f30fa985172d6651cadfb2d77963d66112be78
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,7 @@ Version History
|
|
3
3
|
* All Version bumps are required to update this file as well!!
|
4
4
|
----
|
5
5
|
|
6
|
+
* 17.3.0 Set `ENV['SIMULATE_AUTH_OUTAGE']` to true to throw a `Cb::ServiceUnavailableError` for all API calls.
|
6
7
|
* 17.2.0 Give back more information about the API caller for timings
|
7
8
|
* 17.1.0 Start sending timings to all observers for API calls
|
8
9
|
* 17.0.2 making sure we explicitly ask for version 1 of the consumer APIs
|
data/lib/cb/utils/validator.rb
CHANGED
@@ -14,10 +14,14 @@ module Cb
|
|
14
14
|
|
15
15
|
def raise_response_code_errors(response)
|
16
16
|
code = response.code rescue nil
|
17
|
-
raise Cb::ServiceUnavailableError if code == 503
|
17
|
+
raise Cb::ServiceUnavailableError if (code == 503 || simulate_auth_outage?)
|
18
18
|
raise Cb::UnauthorizedError if code == 401
|
19
19
|
end
|
20
20
|
|
21
|
+
def simulate_auth_outage?
|
22
|
+
ENV['SIMULATE_AUTH_OUTAGE'].to_s.downcase == 'true'
|
23
|
+
end
|
24
|
+
|
21
25
|
def process_response_body(response)
|
22
26
|
body = response.response.body rescue nil
|
23
27
|
return Hash.new if !body
|
data/lib/cb/version.rb
CHANGED