forest_admin_rpc_agent 1.30.5 → 1.30.6
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 +4 -4
- data/lib/forest_admin_rpc_agent/routes/action_execute.rb +0 -2
- data/lib/forest_admin_rpc_agent/routes/action_form.rb +0 -2
- data/lib/forest_admin_rpc_agent/routes/aggregate.rb +1 -3
- data/lib/forest_admin_rpc_agent/routes/base_route.rb +13 -13
- data/lib/forest_admin_rpc_agent/routes/chart.rb +0 -2
- data/lib/forest_admin_rpc_agent/routes/create.rb +0 -2
- data/lib/forest_admin_rpc_agent/routes/delete.rb +0 -2
- data/lib/forest_admin_rpc_agent/routes/list.rb +0 -2
- data/lib/forest_admin_rpc_agent/routes/update.rb +0 -2
- data/lib/forest_admin_rpc_agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53b5e12f818c23964ae83123b35aa0c519c3ff2ac455ba2c518fea37b37e4d2c
|
|
4
|
+
data.tar.gz: fd85d6d60ab150a0375dbfb9681696b28b6f93c4f1e94a30646e2e34c3a8adad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80e426d3044d3d93494696987be64a46d2033d8547bb5aecb09cb101b69268864d450fc8a4a7c17ac813a1c1db56a173f82a699d4a6ff2b4b73aa420451338c6
|
|
7
|
+
data.tar.gz: 739cd6a8a363d9bc8ebb28480d958f5aed1fd488021cba32ee1568512c5a11517698f9d2f856776dcfcd0f4ab6936f1640c780c3c78e2ef3246aea0a282a8e86
|
|
@@ -12,8 +12,6 @@ module ForestAdminRpcAgent
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def handle_request(args)
|
|
15
|
-
return {} unless args[:params]['collection_name']
|
|
16
|
-
|
|
17
15
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
16
|
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
17
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
@@ -12,8 +12,6 @@ module ForestAdminRpcAgent
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def handle_request(args)
|
|
15
|
-
return {} unless args[:params]['collection_name']
|
|
16
|
-
|
|
17
15
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
16
|
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
17
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
@@ -12,15 +12,13 @@ module ForestAdminRpcAgent
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def handle_request(args)
|
|
15
|
-
return {} unless args[:params]['collection_name']
|
|
16
|
-
|
|
17
15
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
16
|
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
17
|
|
|
20
18
|
aggregation = Aggregation.new(
|
|
21
19
|
operation: args[:params]['aggregation']['operation'],
|
|
22
20
|
field: args[:params]['aggregation']['field'],
|
|
23
|
-
groups: args[:params]['aggregation']['groups']
|
|
21
|
+
groups: args[:params]['aggregation']['groups'] || []
|
|
24
22
|
)
|
|
25
23
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
26
24
|
|
|
@@ -39,16 +39,16 @@ module ForestAdminRpcAgent
|
|
|
39
39
|
|
|
40
40
|
# Skip authentication for health check (root path)
|
|
41
41
|
if @url == '/'
|
|
42
|
-
params =
|
|
43
|
-
result = handle_request({ params: params
|
|
42
|
+
params = extract_request_params(request)
|
|
43
|
+
result = handle_request({ params: params, caller: nil, request: request })
|
|
44
44
|
build_rails_response(result)
|
|
45
45
|
else
|
|
46
46
|
auth_middleware = ForestAdminRpcAgent::Middleware::Authentication.new(->(_env) { [200, {}, ['OK']] })
|
|
47
47
|
status, headers, response = auth_middleware.call(request.env)
|
|
48
48
|
|
|
49
49
|
if status == 200
|
|
50
|
-
params =
|
|
51
|
-
result = handle_request({ params: params
|
|
50
|
+
params = extract_request_params(request)
|
|
51
|
+
result = handle_request({ params: params, caller: headers[:caller], request: request })
|
|
52
52
|
build_rails_response(result)
|
|
53
53
|
else
|
|
54
54
|
[status, headers, response]
|
|
@@ -87,15 +87,15 @@ module ForestAdminRpcAgent
|
|
|
87
87
|
|
|
88
88
|
private
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
# Merge path params (e.g. :collection_name from the URL) with query and body params so
|
|
91
|
+
# consumers that don't duplicate `collection_name` in the body (the Node datasource-rpc)
|
|
92
|
+
# still resolve the route correctly.
|
|
93
|
+
def extract_request_params(request)
|
|
94
|
+
request.path_parameters
|
|
95
|
+
.except(:controller, :action, :format)
|
|
96
|
+
.merge(request.query_parameters)
|
|
97
|
+
.merge(request.request_parameters)
|
|
98
|
+
.with_indifferent_access
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
def serialize_response(result)
|
|
@@ -10,8 +10,6 @@ module ForestAdminRpcAgent
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def handle_request(args)
|
|
13
|
-
return {} unless args[:params]['collection_name']
|
|
14
|
-
|
|
15
13
|
chart_name = args[:params]['chart']
|
|
16
14
|
parameters = args[:params]['parameters']
|
|
17
15
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
@@ -8,8 +8,6 @@ module ForestAdminRpcAgent
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def handle_request(args)
|
|
11
|
-
return {} unless args[:params]['collection_name']
|
|
12
|
-
|
|
13
11
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
14
12
|
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
15
13
|
|
|
@@ -12,8 +12,6 @@ module ForestAdminRpcAgent
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def handle_request(args)
|
|
15
|
-
return {} unless args[:params]['collection_name']
|
|
16
|
-
|
|
17
15
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
16
|
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
17
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|
|
@@ -12,8 +12,6 @@ module ForestAdminRpcAgent
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def handle_request(args)
|
|
15
|
-
return {} unless args[:params]['collection_name']
|
|
16
|
-
|
|
17
15
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
18
16
|
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
19
17
|
projection = Projection.new(args[:params]['projection'])
|
|
@@ -10,8 +10,6 @@ module ForestAdminRpcAgent
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def handle_request(args)
|
|
13
|
-
return {} unless args[:params]['collection_name']
|
|
14
|
-
|
|
15
13
|
datasource = ForestAdminRpcAgent::Facades::Container.datasource
|
|
16
14
|
collection = get_collection_safe(datasource, args[:params]['collection_name'])
|
|
17
15
|
filter = FilterFactory.from_plain_object(args[:params]['filter'])
|