forest_admin_agent 1.9.0 → 1.9.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: db02d65763186ba3ebdb9a253ca60c7a292c00f4b52d54e841be1ab4cd05702b
4
- data.tar.gz: 87bd836d1d1f461d7aed416d8bb43397067f1575331974df1ac59ec32bbb415d
3
+ metadata.gz: d85148dc0247c3d0d74c458344980576ec7aa14772a8015d237b2b63cfdd88c3
4
+ data.tar.gz: ba8f07da138797ad91f931ab56db345dd37d3f8ca13d95655b28af2180594b8b
5
5
  SHA512:
6
- metadata.gz: 241d1f8f861ed041334c14713018b0c0609d4193e4821c1d517975b1e780b57fc5e606fae505799f73393b700117e17cc53b8218b1a6595d71d238fc9d887cda
7
- data.tar.gz: 434548e00921d627fa800d10834980476afaf3bd3a3ef5e2e80bca7bd64263622284bae86c28449b3708ac507847ff8326c6029163164930564da7fd601eb385
6
+ metadata.gz: e4c49cc7ef501eeb34283106e9f21e12b992570afb17974ba30581d7076749d2d647e5bc539fc22145d75deaf693f547a7c1e2441285967244479cd40c44ffad
7
+ data.tar.gz: 4468d234313447da09cbfb88907db657bc0ba51f238c5fa18c43aa45b274d59eb0593507838c1cd78c387a1ae6ec158d83e3f524823889ad13fc22c6c85af568
@@ -87,7 +87,26 @@ module ForestAdminAgent
87
87
  def fetch_rules
88
88
  response = forest_api.get('/liana/v1/ip-whitelist-rules')
89
89
 
90
- body = JSON.parse(response.body)
90
+ unless response.status == 200
91
+ ForestAdminAgent::Facades::Container.logger.log('Error', {
92
+ error: "HTTP #{response.status}",
93
+ status: response.status,
94
+ response: response.body
95
+ })
96
+ raise ForestAdminAgent::Error, ForestAdminAgent::Utils::ErrorMessages::UNEXPECTED
97
+ end
98
+
99
+ begin
100
+ body = JSON.parse(response.body)
101
+ rescue JSON::ParserError => e
102
+ ForestAdminAgent::Facades::Container.logger.log('Error', {
103
+ error: e.message,
104
+ status: response.status,
105
+ response: response.body
106
+ })
107
+ raise ForestAdminAgent::Error, ForestAdminAgent::Utils::ErrorMessages::UNEXPECTED
108
+ end
109
+
91
110
  ip_whitelist_data = body['data']['attributes']
92
111
 
93
112
  @use_ip_whitelist = ip_whitelist_data['use_ip_whitelist']
@@ -6,7 +6,7 @@ module ForestAdminAgent
6
6
  module Schema
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "agent-ruby"
9
- LIANA_VERSION = "1.9.0"
9
+ LIANA_VERSION = "1.9.1"
10
10
 
11
11
  def self.generate(datasource)
12
12
  datasource.collections
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.9.0"
2
+ VERSION = "1.9.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-10-20 00:00:00.000000000 Z
12
+ date: 2025-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport