oso-cloud 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/oso/api.rb +11 -1
- data/lib/oso/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: 78d81ade4fd246a2398c1a0224ecc8a6ff3852b968e03c0c79c1d28295358cfd
|
4
|
+
data.tar.gz: cdfa7bb5f957f1aaf7d801d8b5bca4e3e2dc4b1df8044d9cc30114aae5d012fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc3fa7da1c706b47ffe89e6d9ed03ed9950cb8c756051ef2cc3e7ed81e2931f34dbdad8e6c8e217f9d061a4c9a2d5ad36784acdbba0772a3d16102bc43d8e09f
|
7
|
+
data.tar.gz: e48be352ec530bfb99afe81723abbfca673a9c63d295388d68f34bebf97b973a8c911d68133cc11668622cef26553cb92e5336346b1410d081bd1dac41c9c881
|
data/Gemfile.lock
CHANGED
data/lib/oso/api.rb
CHANGED
@@ -3,6 +3,7 @@ require 'uri'
|
|
3
3
|
require 'faraday'
|
4
4
|
require 'faraday/retry'
|
5
5
|
require 'faraday/net_http_persistent'
|
6
|
+
require 'securerandom'
|
6
7
|
|
7
8
|
require 'oso/helpers'
|
8
9
|
require 'oso/version'
|
@@ -332,6 +333,7 @@ module OsoCloud
|
|
332
333
|
@user_agent = "Oso Cloud (ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}; rv:#{VERSION})"
|
333
334
|
@last_offset = nil
|
334
335
|
@data_bindings = IO.read(data_bindings) unless data_bindings.nil?
|
336
|
+
@client_id = SecureRandom.uuid
|
335
337
|
end
|
336
338
|
|
337
339
|
def fallback_eligible(path)
|
@@ -484,6 +486,8 @@ module OsoCloud
|
|
484
486
|
Accept: 'application/json',
|
485
487
|
'Content-Type': 'application/json',
|
486
488
|
'X-OsoApiVersion': '0',
|
489
|
+
'X-Request-ID' => SecureRandom.uuid,
|
490
|
+
'X-Oso-Instance-Id' => @client_id
|
487
491
|
}
|
488
492
|
# set OsoOffset is last_offset is not nil
|
489
493
|
default_headers[:OsoOffset] = @last_offset unless @last_offset.nil?
|
@@ -549,12 +553,18 @@ module OsoCloud
|
|
549
553
|
|
550
554
|
def handle_faraday_error(error)
|
551
555
|
resp = error.response
|
556
|
+
formatted_request_id = if resp.nil? || resp[:headers].nil? || resp[:headers]['X-Request-ID'].nil?
|
557
|
+
""
|
558
|
+
else
|
559
|
+
" (Request ID: " + resp[:headers]['X-Request-ID'] + ")"
|
560
|
+
end
|
561
|
+
|
552
562
|
err = if resp.nil? || resp[:body].nil? || resp[:body][:message].nil?
|
553
563
|
error.message
|
554
564
|
else
|
555
565
|
resp[:body][:message]
|
556
566
|
end
|
557
|
-
raise ApiError.new(message: err)
|
567
|
+
raise ApiError.new(message: err + formatted_request_id)
|
558
568
|
end
|
559
569
|
end
|
560
570
|
end
|
data/lib/oso/version.rb
CHANGED
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.7.
|
4
|
+
version: 1.7.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: 2024-
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|