forest_admin_rpc_agent 1.14.2 → 1.14.3
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0b29388c9259dd65fd78333575a61c94bfb17a5c5252bd6bc134617dd9a047d
|
|
4
|
+
data.tar.gz: fb83146a2e6a9f293ddcef134cc783e719fa364539c6f6b0f22089e4790669ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee9ffd869cc213e77f60a01005823db71f122a05e3b570c89850d0f38ddf7cd76f461513b36560c9064c81ddc82e7b55fc191bb206533c60cb0b84bb066b2d3d
|
|
7
|
+
data.tar.gz: 7e0415a83fde513f4b77fc521339c661a65d9e2d8ca511b2a64524542f4323f1f3151645b9ce50e1c24e722a415397ce98c370304ae7bd32795d84ba27d2dff4
|
|
@@ -21,7 +21,13 @@ module ForestAdminRpcAgent
|
|
|
21
21
|
def register_sinatra(app)
|
|
22
22
|
app.send(@method.to_sym, @url) do
|
|
23
23
|
result = handle_request(params)
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
if result.is_a?(Hash) && result.key?(:status)
|
|
26
|
+
status result[:status]
|
|
27
|
+
result[:content] ? serialize_response(result[:content]) : ''
|
|
28
|
+
else
|
|
29
|
+
serialize_response(result)
|
|
30
|
+
end
|
|
25
31
|
end
|
|
26
32
|
end
|
|
27
33
|
|
|
@@ -29,15 +35,22 @@ module ForestAdminRpcAgent
|
|
|
29
35
|
handler = proc do |hash|
|
|
30
36
|
request = ActionDispatch::Request.new(hash)
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if status == 200
|
|
38
|
+
# Skip authentication for health check (root path)
|
|
39
|
+
if @url == '/'
|
|
36
40
|
params = request.query_parameters.merge(request.request_parameters)
|
|
37
|
-
result = handle_request({ params: params, caller:
|
|
41
|
+
result = handle_request({ params: params, caller: nil })
|
|
38
42
|
[200, { 'Content-Type' => 'application/json' }, [serialize_response(result)]]
|
|
39
43
|
else
|
|
40
|
-
[
|
|
44
|
+
auth_middleware = ForestAdminRpcAgent::Middleware::Authentication.new(->(_env) { [200, {}, ['OK']] })
|
|
45
|
+
status, headers, response = auth_middleware.call(request.env)
|
|
46
|
+
|
|
47
|
+
if status == 200
|
|
48
|
+
params = request.query_parameters.merge(request.request_parameters)
|
|
49
|
+
result = handle_request({ params: params, caller: headers[:caller] })
|
|
50
|
+
[200, { 'Content-Type' => 'application/json' }, [serialize_response(result)]]
|
|
51
|
+
else
|
|
52
|
+
[status, headers, response]
|
|
53
|
+
end
|
|
41
54
|
end
|
|
42
55
|
end
|
|
43
56
|
|
|
@@ -2,11 +2,11 @@ module ForestAdminRpcAgent
|
|
|
2
2
|
module Routes
|
|
3
3
|
class HealthRoute < BaseRoute
|
|
4
4
|
def initialize
|
|
5
|
-
super('
|
|
5
|
+
super('/', 'get', 'rpc_forest')
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def handle_request(_params)
|
|
9
|
-
{
|
|
9
|
+
{ error: nil, message: 'Agent is running' }
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_admin_rpc_agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.14.
|
|
4
|
+
version: 1.14.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthieu
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2025-11-
|
|
12
|
+
date: 2025-11-14 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: base64
|