oso-cloud 1.3.0.dev.0 → 1.3.0.dev.1

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: 93c11d4552281f1cbf95ec309bbbcd5e8d1289a7f0ee2000724f8d6eb4386617
4
- data.tar.gz: 62fd22884497116c5db29b06a012b2b06ad82de78b96ed4823b0dbd22862ef37
3
+ metadata.gz: ea1469d68034a213af21a5a0300d2b1b1c7df2d00a3a2518f0a5e48fc0b5756b
4
+ data.tar.gz: 9491bc2e2bc622296b16a473c0996fdb89a67eb2242f046637ccba173a9e9fb4
5
5
  SHA512:
6
- metadata.gz: 5139439b2e01ab083c0e73827ddb520a54dc0c2606d1ca20203bad6b56fc446f747a638cc603a83584da35ae65e500ecf4354fd53065c109fa044aef6ba2950f
7
- data.tar.gz: eac48b47137286b49a1e27197cfb7867bbcd982b6fe6523f9e50ed9d8659934ceaea9b548f3d543510e9983872c9a9859400d417f149af8ef82f9319ea7b9f3e
6
+ metadata.gz: 4baf074d8e2a237287699be969ad02959f5ba1c626cc582c0542931c198cc3c7728b5aa2ec5fa1d323a1368a027d7734fea5c07490247df81f16153c4192cdc4
7
+ data.tar.gz: '083f190963c58855ac7c5514a07f4547edb2d4b01cb01ac1ef2e11594375401d1b5481a23811134ac484242b8a257a1897e57c36da59241da4a2e95e6fc4d694'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oso-cloud (1.2.0)
4
+ oso-cloud (1.3.0.dev.0)
5
5
  faraday (~> 2.5.2)
6
6
  faraday-retry (~> 2.0.0)
7
7
  faraday-typhoeus (~> 1.0.0)
data/lib/oso/api.rb CHANGED
@@ -392,20 +392,29 @@ module OsoCloud
392
392
  end
393
393
 
394
394
  def POST_BATCH(path, params, body_array, isMutation)
395
- responses = []
396
395
  @connection.in_parallel do
397
- body_array.each do |body|
398
- responses << @connection.post("api#{path}") do |req|
399
- req.params = params unless params.nil?
400
- req.body = OsoCloud::Helpers.to_hash(body) unless body.nil?
401
- req.headers = headers
396
+ @responses = body_array.map do |body|
397
+ @connection.post("api#{path}") do |req|
398
+ req.params = params unless params.nil?
399
+ req.body = OsoCloud::Helpers.to_hash(body) unless body.nil?
400
+ req.headers = headers
401
+ end
402
402
  end
403
403
  end
404
+
405
+ connection_failed = @responses.find { |r| r.env.custom_members[:typhoeus_connection_failed] }
406
+ if connection_failed
407
+ raise Faraday::ConnectionFailed, connection_failed.env.custom_members[:typhoeus_return_message]
408
+ end
409
+
410
+ timed_out = @responses.find { |r| r.env.custom_members[:typhoeus_timed_out] }
411
+ if timed_out
412
+ raise Faraday::TimeoutError, timed_out.env.custom_members[:typhoeus_return_message]
404
413
  end
405
414
  if isMutation
406
- @last_offset = responses[-1].headers[:OsoOffset]
415
+ @last_offset = @responses[-1].headers[:OsoOffset]
407
416
  end
408
- responses
417
+ @responses
409
418
  rescue Faraday::Error => e
410
419
  handle_faraday_error e
411
420
  end
data/lib/oso/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module OsoCloud
2
- VERSION = '1.3.0.dev.0'.freeze
2
+ VERSION = '1.3.0.dev.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oso-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0.dev.0
4
+ version: 1.3.0.dev.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oso Security, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-22 00:00:00.000000000 Z
11
+ date: 2023-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday