forest_liana 6.4.0 → 6.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/forest_liana/smart_actions_controller.rb +1 -4
- data/app/services/forest_liana/apimap_sorter.rb +1 -0
- data/app/services/forest_liana/line_stat_getter.rb +1 -1
- data/app/services/forest_liana/permissions_checker.rb +1 -1
- data/app/services/forest_liana/token.rb +1 -0
- data/app/services/forest_liana/utils/beta_schema_utils.rb +1 -1
- data/lib/forest_liana/bootstrapper.rb +4 -2
- data/lib/forest_liana/version.rb +1 -1
- data/spec/lib/forest_liana/bootstrapper_spec.rb +12 -0
- data/spec/requests/authentications_spec.rb +2 -1
- data/spec/services/forest_liana/apimap_sorter_spec.rb +6 -4
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56720f9edd9f48712a65f46e41447785aa04772b3de3f0ef959faea901a3fd97
|
4
|
+
data.tar.gz: 4b26438ea7fb4a2cc807c35c29366697650fe27c11963cf177f631d13b953918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ba707e8b91588054a0c38de31dc9a02ed5603d0b164ca8040bbe97b08dd426493795dfe283f8af0c49d2ebef73f9c64ff3d18a07e01038cea1ee371ff35286e
|
7
|
+
data.tar.gz: da40468756bdb066b0c45a400e35bab3e2c2846b38efe773dfaae5e3b48b453d9e9a2451fd532702c0d032027bf03541d0151c3ee85f27827a8deed3a7d1131f
|
@@ -57,11 +57,8 @@ module ForestLiana
|
|
57
57
|
|
58
58
|
# smart action permissions are retrieved from the action's endpoint and http_method
|
59
59
|
def get_smart_action_request_info
|
60
|
-
endpoint = request.fullpath
|
61
|
-
# Trim starting '/'
|
62
|
-
endpoint[0] = '' if endpoint[0] == '/'
|
63
60
|
{
|
64
|
-
endpoint:
|
61
|
+
endpoint: request.fullpath,
|
65
62
|
http_method: request.request_method
|
66
63
|
}
|
67
64
|
end
|
@@ -23,7 +23,7 @@ module ForestLiana
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def perform
|
26
|
-
value = get_resource().
|
26
|
+
value = get_resource().joins(@includes)
|
27
27
|
|
28
28
|
unless @params[:filters].blank?
|
29
29
|
value = FiltersParser.new(@params[:filters], value, @params[:timezone]).apply_filters
|
@@ -177,7 +177,7 @@ module ForestLiana
|
|
177
177
|
return false unless pool_permissions
|
178
178
|
|
179
179
|
# NOTICE: equivalent to Object.values in js & removes nil values
|
180
|
-
array_permission_infos = @query_request_info.values.
|
180
|
+
array_permission_infos = @query_request_info.values.select{ |x| !x.nil? }
|
181
181
|
|
182
182
|
# NOTICE: Is there any pool_permissions containing the array_permission_infos
|
183
183
|
return pool_permissions.any? {
|
@@ -6,7 +6,7 @@ module ForestLiana
|
|
6
6
|
|
7
7
|
return nil unless collection
|
8
8
|
|
9
|
-
collection.actions.find { |action| action.endpoint == endpoint && action.http_method == http_method }
|
9
|
+
collection.actions.find { |action| (action.endpoint == endpoint || "/#{action.endpoint}" == endpoint) && action.http_method == http_method }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -203,10 +203,12 @@ module ForestLiana
|
|
203
203
|
|
204
204
|
def setup_forest_liana_meta
|
205
205
|
ForestLiana.meta = {
|
206
|
-
database_type: database_type,
|
207
206
|
liana: 'forest-rails',
|
208
207
|
liana_version: ForestLiana::VERSION,
|
209
|
-
|
208
|
+
stack: {
|
209
|
+
database_type: database_type,
|
210
|
+
orm_version: Gem.loaded_specs["activerecord"].version.version,
|
211
|
+
}
|
210
212
|
}
|
211
213
|
end
|
212
214
|
|
data/lib/forest_liana/version.rb
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
module ForestLiana
|
2
|
+
describe Bootstrapper do
|
3
|
+
describe 'setup_forest_liana_meta' do
|
4
|
+
it "should put statistic data related to user stack on a dedicated object" do
|
5
|
+
expect(ForestLiana.meta[:stack])
|
6
|
+
.to include(:orm_version)
|
7
|
+
expect(ForestLiana.meta[:stack])
|
8
|
+
.to include(:database_type)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -45,7 +45,7 @@ describe "Authentications", type: :request do
|
|
45
45
|
|
46
46
|
describe "GET /authentication/callback" do
|
47
47
|
before() do
|
48
|
-
response = '{"data":{"id":666,"attributes":{"first_name":"Alice","last_name":"Doe","email":"alice@forestadmin.com","teams":[1,2,3]}}}'
|
48
|
+
response = '{"data":{"id":666,"attributes":{"first_name":"Alice","last_name":"Doe","email":"alice@forestadmin.com","teams":[1,2,3],"role":"Test"}}}'
|
49
49
|
allow(ForestLiana::ForestApiRequester).to receive(:get).with(
|
50
50
|
"/liana/v2/renderings/42/authorization", { :headers => { "forest-token" => "THE-ACCESS-TOKEN" }, :query=> {} }
|
51
51
|
).and_return(
|
@@ -72,6 +72,7 @@ describe "Authentications", type: :request do
|
|
72
72
|
"first_name" => 'Alice',
|
73
73
|
"last_name" => 'Doe',
|
74
74
|
"team" => 1,
|
75
|
+
"role" => "Test",
|
75
76
|
}
|
76
77
|
|
77
78
|
expect(decoded).to include(expected_token_data)
|
@@ -4,9 +4,11 @@ module ForestLiana
|
|
4
4
|
context 'on a disordered apimap' do
|
5
5
|
apimap = {
|
6
6
|
'meta': {
|
7
|
-
|
7
|
+
stack: {
|
8
|
+
'orm_version': '4.34.9',
|
9
|
+
'database_type': 'postgresql',
|
10
|
+
},
|
8
11
|
'liana_version': '1.5.24',
|
9
|
-
'database_type': 'postgresql',
|
10
12
|
liana: 'forest-rails',
|
11
13
|
},
|
12
14
|
'data': [{
|
@@ -165,8 +167,8 @@ module ForestLiana
|
|
165
167
|
end
|
166
168
|
|
167
169
|
it 'should sort the meta values' do
|
168
|
-
expect(apimap_sorted['meta'].keys).to eq(
|
169
|
-
|
170
|
+
expect(apimap_sorted['meta'].keys).to eq(['liana', 'liana_version', 'stack'])
|
171
|
+
expect(apimap_sorted['meta']['stack'].keys).to eq(['database_type', 'orm_version'])
|
170
172
|
end
|
171
173
|
end
|
172
174
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -371,6 +371,7 @@ files:
|
|
371
371
|
- spec/helpers/forest_liana/is_same_data_structure_helper_spec.rb
|
372
372
|
- spec/helpers/forest_liana/query_helper_spec.rb
|
373
373
|
- spec/helpers/forest_liana/schema_helper_spec.rb
|
374
|
+
- spec/lib/forest_liana/bootstrapper_spec.rb
|
374
375
|
- spec/rails_helper.rb
|
375
376
|
- spec/requests/actions_controller_spec.rb
|
376
377
|
- spec/requests/authentications_spec.rb
|
@@ -663,6 +664,7 @@ test_files:
|
|
663
664
|
- spec/dummy/app/models/location.rb
|
664
665
|
- spec/dummy/app/models/island.rb
|
665
666
|
- spec/dummy/app/models/reference.rb
|
667
|
+
- spec/lib/forest_liana/bootstrapper_spec.rb
|
666
668
|
- spec/rails_helper.rb
|
667
669
|
- spec/requests/stats_spec.rb
|
668
670
|
- spec/requests/resources_spec.rb
|