reso_api 1.8.11 → 1.8.13
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/reso_api/app/models/reso/api/client.rb +25 -2
- data/lib/reso_api/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: 58fe7ec4d146147d271a0d45ac51c93c63a859657a2e490f13154cb2544d7c5c
|
|
4
|
+
data.tar.gz: 61e76715b6167377f8ada506a1009a0d17ba4cf7de1137ef0292182b1e64315a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7f18a11f9d0a9097c5a2283faa8143af934d9a9ddc2061573d36c29e9f5890874320923dc6a39a99e5d66e53160a17c2af8002c2a95c78b288310a39b66a9ec
|
|
7
|
+
data.tar.gz: 985cf3cb78aff919b99cb8c23668bb58a8e95e6a9b5a4f33466480894285adeab861be59315e0d1154484fffafded483a221be5dd61a1eca45142d414ee02129
|
|
@@ -9,6 +9,7 @@ module RESO
|
|
|
9
9
|
require 'tmpdir'
|
|
10
10
|
|
|
11
11
|
attr_accessor :access_token, :client_id, :client_secret, :auth_url, :base_url, :scope, :osn
|
|
12
|
+
attr_reader :last_request_url
|
|
12
13
|
|
|
13
14
|
def initialize(**opts)
|
|
14
15
|
@access_token, @client_id, @client_secret, @auth_url, @base_url, @scope, @osn = opts.values_at(:access_token, :client_id, :client_secret, :auth_url, :base_url, :scope, :osn)
|
|
@@ -239,12 +240,27 @@ module RESO
|
|
|
239
240
|
return URI::decode(uri.request_uri) if params.dig(:$debug).present?
|
|
240
241
|
end
|
|
241
242
|
|
|
243
|
+
# Store the full request URL for debugging
|
|
244
|
+
@last_request_url = uri.to_s
|
|
245
|
+
|
|
242
246
|
begin
|
|
243
247
|
req = Net::HTTP::Get.new(uri.request_uri)
|
|
244
248
|
req['Authorization'] = "Bearer #{auth_token}"
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
|
|
250
|
+
# Configure HTTP object before starting connection
|
|
251
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
252
|
+
http.use_ssl = (uri.scheme == 'https')
|
|
253
|
+
|
|
254
|
+
if http.use_ssl?
|
|
255
|
+
# Configure certificate store to avoid CRL checking issues with OpenSSL 3.5+
|
|
256
|
+
# This maintains certificate chain verification while preventing CRL-related failures
|
|
257
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
258
|
+
store = OpenSSL::X509::Store.new
|
|
259
|
+
store.set_default_paths
|
|
260
|
+
http.cert_store = store
|
|
247
261
|
end
|
|
262
|
+
|
|
263
|
+
res = http.request(req)
|
|
248
264
|
response = JSON(res.body) rescue res.body
|
|
249
265
|
if response.is_a?(String) && response.include?('Bad Gateway')
|
|
250
266
|
puts "Error: Bad Gateway." if debug
|
|
@@ -270,6 +286,13 @@ module RESO
|
|
|
270
286
|
raise
|
|
271
287
|
end
|
|
272
288
|
end
|
|
289
|
+
|
|
290
|
+
# Add metadata to response hash (if response is a hash)
|
|
291
|
+
if response.is_a?(Hash)
|
|
292
|
+
response['@reso_request_url'] = @last_request_url
|
|
293
|
+
response['@reso_auth_scope'] = scope
|
|
294
|
+
end
|
|
295
|
+
|
|
273
296
|
return response
|
|
274
297
|
end
|
|
275
298
|
|
data/lib/reso_api/version.rb
CHANGED