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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e81ebb68ef64ed1eb595cf0a92fd03044c03b28e84d40a31fa49e7660ab65a08
4
- data.tar.gz: 508a035516cbbf60b0d7d606a6277edcf0e72cfb063cf5f2497761f9e1b71d7f
3
+ metadata.gz: 58fe7ec4d146147d271a0d45ac51c93c63a859657a2e490f13154cb2544d7c5c
4
+ data.tar.gz: 61e76715b6167377f8ada506a1009a0d17ba4cf7de1137ef0292182b1e64315a
5
5
  SHA512:
6
- metadata.gz: 426229c6c88d7cf4e91f6237989a94b91086af2ef9ad04063638c5ac230851fdccd7a9520d6c30c587cb43009eb93505b93136bb40d2d5894d443fadce286a97
7
- data.tar.gz: 56f7d6afc8f864cec994b91a1ca8906ef7b48e9209d51fa7e4a8974e03210e254d77f40ccd8e4a238653fbbc47497d6139f3d80d11f161033ac1bb9a5187babc
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
- res = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
246
- http.request(req)
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
 
@@ -1,3 +1,3 @@
1
1
  module ResoApi
2
- VERSION = "1.8.11"
2
+ VERSION = "1.8.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reso_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.11
4
+ version: 1.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Edlund