forest_liana 6.6.2 → 7.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/forest_liana/application_controller.rb +2 -2
  3. data/app/controllers/forest_liana/associations_controller.rb +1 -1
  4. data/app/controllers/forest_liana/base_controller.rb +1 -1
  5. data/app/controllers/forest_liana/resources_controller.rb +6 -6
  6. data/app/controllers/forest_liana/smart_actions_controller.rb +4 -1
  7. data/app/serializers/forest_liana/intercom_attribute_serializer.rb +1 -1
  8. data/app/serializers/forest_liana/intercom_conversation_serializer.rb +1 -1
  9. data/app/serializers/forest_liana/mixpanel_event_serializer.rb +1 -1
  10. data/app/serializers/forest_liana/serializer_factory.rb +1 -1
  11. data/app/serializers/forest_liana/stat_serializer.rb +1 -1
  12. data/app/serializers/forest_liana/stripe_bank_account_serializer.rb +1 -1
  13. data/app/serializers/forest_liana/stripe_card_serializer.rb +1 -1
  14. data/app/serializers/forest_liana/stripe_invoice_serializer.rb +1 -1
  15. data/app/serializers/forest_liana/stripe_payment_serializer.rb +1 -1
  16. data/app/serializers/forest_liana/stripe_subscription_serializer.rb +1 -1
  17. data/app/services/forest_liana/apimap_sorter.rb +0 -1
  18. data/app/services/forest_liana/line_stat_getter.rb +1 -1
  19. data/app/services/forest_liana/permissions_checker.rb +14 -19
  20. data/app/services/forest_liana/token.rb +0 -1
  21. data/app/services/forest_liana/utils/beta_schema_utils.rb +1 -1
  22. data/lib/forest_liana/bootstrapper.rb +3 -5
  23. data/lib/forest_liana/version.rb +1 -1
  24. data/spec/requests/authentications_spec.rb +1 -2
  25. data/spec/services/forest_liana/apimap_sorter_spec.rb +4 -6
  26. data/spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb +3 -9
  27. data/spec/services/forest_liana/permissions_checker_live_queries_spec.rb +2 -2
  28. metadata +140 -142
  29. data/spec/lib/forest_liana/bootstrapper_spec.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c09d00ec3f4c4c72cd36b9be6316fc42fa568ad959dbab90645f04c444e9e91
4
- data.tar.gz: b01ca1c1b257ed31805deba1bb886dc041ef9545c38f9120f505d8369d066b7d
3
+ metadata.gz: 69b23785cf391fb245efbf6488e58fb19bbbc010e9dac0a91574412684e89129
4
+ data.tar.gz: 26d9dd7b466009b8a09182dec02778b729e58b83c7b717811c45dca5ce6cc032
5
5
  SHA512:
6
- metadata.gz: 6fc61c7b395475da62ea7da9068941dbf88386a8cd85616568febe897816ab58d1fbef4907ead68be9f2e954afc3a89549015303d1b743e6a684b906a4bf7398
7
- data.tar.gz: 31d8fb2855a56dcbd05f6f35c30a63c77843e90adf355aaff95d569a3f70c943acd146cdfa77328dadfd26f8ce816cd3fa557cf8338ce5b2975810ae52c6aa0e
6
+ metadata.gz: e216bb8280e6adc87f2ab5f4c0d1a2937306ba1237aedcc9b80375a742227bcdf2187e74b573691324f55d9ef13843b397c25348d442a3e211eda2d8c20cb06c
7
+ data.tar.gz: a3e736ae280744d93d65f9592ff9b9475f1f2b22b24790ee37b202ad361f0f192ff0a2bf87dd2669327492b24d2afee3000130af925d38788879512e086da24e
@@ -34,14 +34,14 @@ module ForestLiana
34
34
 
35
35
  def serialize_model(record, options = {})
36
36
  options[:is_collection] = false
37
- json = JSONAPI::Serializer.serialize(record, options)
37
+ json = ForestAdmin::JSONAPI::Serializer.serialize(record, options)
38
38
 
39
39
  force_utf8_encoding(json)
40
40
  end
41
41
 
42
42
  def serialize_models(records, options = {}, fields_searched = [])
43
43
  options[:is_collection] = true
44
- json = JSONAPI::Serializer.serialize(records, options)
44
+ json = ForestAdmin::JSONAPI::Serializer.serialize(records, options)
45
45
 
46
46
  if options[:params] && options[:params][:search]
47
47
  # NOTICE: Add the Smart Fields with a 'String' type.
@@ -41,7 +41,7 @@ module ForestLiana
41
41
  updater.perform
42
42
 
43
43
  if updater.errors
44
- render serializer: nil, json: JSONAPI::Serializer.serialize_errors(
44
+ render serializer: nil, json: ForestAdmin::JSONAPI::Serializer.serialize_errors(
45
45
  updater.errors), status: 422
46
46
  else
47
47
  head :no_content
@@ -24,7 +24,7 @@ module ForestLiana
24
24
  end
25
25
  end
26
26
  rescue ForestLiana::Errors::ExpectedError => exception
27
- error_data = JSONAPI::Serializer.serialize_errors([{
27
+ error_data = ForestAdmin::JSONAPI::Serializer.serialize_errors([{
28
28
  status: exception.error_code,
29
29
  detail: exception.message
30
30
  }])
@@ -41,7 +41,7 @@ module ForestLiana
41
41
  status: :unprocessable_entity, serializer: nil
42
42
  rescue ForestLiana::Errors::ExpectedError => error
43
43
  error.display_error
44
- error_data = JSONAPI::Serializer.serialize_errors([{
44
+ error_data = ForestAdmin::JSONAPI::Serializer.serialize_errors([{
45
45
  status: error.error_code,
46
46
  detail: error.message
47
47
  }])
@@ -73,7 +73,7 @@ module ForestLiana
73
73
  status: :unprocessable_entity, serializer: nil
74
74
  rescue ForestLiana::Errors::ExpectedError => error
75
75
  error.display_error
76
- error_data = JSONAPI::Serializer.serialize_errors([{
76
+ error_data = ForestAdmin::JSONAPI::Serializer.serialize_errors([{
77
77
  status: error.error_code,
78
78
  detail: error.message
79
79
  }])
@@ -108,12 +108,12 @@ module ForestLiana
108
108
  creator.perform
109
109
 
110
110
  if creator.errors
111
- render serializer: nil, json: JSONAPI::Serializer.serialize_errors(
111
+ render serializer: nil, json: ForestAdmin::JSONAPI::Serializer.serialize_errors(
112
112
  creator.errors), status: 400
113
113
  elsif creator.record.valid?
114
114
  render serializer: nil, json: render_record_jsonapi(creator.record)
115
115
  else
116
- render serializer: nil, json: JSONAPI::Serializer.serialize_errors(
116
+ render serializer: nil, json: ForestAdmin::JSONAPI::Serializer.serialize_errors(
117
117
  creator.record.errors), status: 400
118
118
  end
119
119
  rescue => error
@@ -131,12 +131,12 @@ module ForestLiana
131
131
  updater.perform
132
132
 
133
133
  if updater.errors
134
- render serializer: nil, json: JSONAPI::Serializer.serialize_errors(
134
+ render serializer: nil, json: ForestAdmin::JSONAPI::Serializer.serialize_errors(
135
135
  updater.errors), status: 400
136
136
  elsif updater.record.valid?
137
137
  render serializer: nil, json: render_record_jsonapi(updater.record)
138
138
  else
139
- render serializer: nil, json: JSONAPI::Serializer.serialize_errors(
139
+ render serializer: nil, json: ForestAdmin::JSONAPI::Serializer.serialize_errors(
140
140
  updater.record.errors), status: 400
141
141
  end
142
142
  rescue => error
@@ -57,8 +57,11 @@ 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] == '/'
60
63
  {
61
- endpoint: request.fullpath,
64
+ endpoint: endpoint,
62
65
  http_method: request.request_method
63
66
  }
64
67
  end
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class IntercomAttributeSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :session_count
6
6
  attribute :last_seen_ip
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class IntercomConversationSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :created_at
6
6
  attribute :updated_at
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class MixpanelEventSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :id
6
6
  attribute :event
@@ -53,7 +53,7 @@ module ForestLiana
53
53
 
54
54
  def serializer_for(active_record_class)
55
55
  serializer = Class.new {
56
- include JSONAPI::Serializer
56
+ include ForestAdmin::JSONAPI::Serializer
57
57
 
58
58
  def self_link
59
59
  "/forest#{super.underscore}"
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class StatSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :value
6
6
 
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class StripeBankAccountSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :account_holder_name
6
6
  attribute :account_holder_type
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class StripeCardSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :last4
6
6
  attribute :brand
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class StripeInvoiceSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :amount_due
6
6
  attribute :amount_paid
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class StripePaymentSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :description
6
6
  attribute :refunded
@@ -1,6 +1,6 @@
1
1
  module ForestLiana
2
2
  class StripeSubscriptionSerializer
3
- include JSONAPI::Serializer
3
+ include ForestAdmin::JSONAPI::Serializer
4
4
 
5
5
  attribute :cancel_at_period_end
6
6
  attribute :canceled_at
@@ -92,7 +92,6 @@ module ForestLiana
92
92
  end
93
93
  end
94
94
 
95
- @apimap['meta']['stack'] = reorder_keys_basic(@apimap['meta']['stack'])
96
95
  @apimap['meta'] = reorder_keys_basic(@apimap['meta'])
97
96
  @apimap
98
97
  rescue => exception
@@ -23,7 +23,7 @@ module ForestLiana
23
23
  end
24
24
 
25
25
  def perform
26
- value = get_resource().joins(@includes)
26
+ value = get_resource().eager_load(@includes)
27
27
 
28
28
  unless @params[:filters].blank?
29
29
  value = FiltersParser.new(@params[:filters], value, @params[:timezone]).apply_filters
@@ -1,7 +1,7 @@
1
1
  module ForestLiana
2
2
  class PermissionsChecker
3
3
  @@permissions_cached = Hash.new
4
- @@renderings_cached = Hash.new
4
+ @@scopes_cached = Hash.new
5
5
  @@roles_acl_activated = false
6
6
  # TODO: handle cache scopes per rendering
7
7
  @@expiration_in_seconds = (ENV['FOREST_PERMISSIONS_EXPIRATION_IN_SECONDS'] || 3600).to_i
@@ -39,16 +39,13 @@ module ForestLiana
39
39
  permissions['data'] = ForestLiana::PermissionsFormatter.convert_to_new_format(permissions['data'], @rendering_id)
40
40
  @@permissions_cached[@rendering_id] = permissions
41
41
  end
42
-
43
- # NOTICE: Add stats permissions to the RenderingPermissions
44
- permissions['data']['renderings'][@rendering_id]['stats'] = permissions['stats']
45
42
  add_scopes_to_cache(permissions)
46
43
  end
47
44
 
48
45
  def add_scopes_to_cache(permissions)
49
46
  permissions['data']['renderings'].keys.each { |rendering_id|
50
- @@renderings_cached[rendering_id] = permissions['data']['renderings'][rendering_id]
51
- @@renderings_cached[rendering_id]['last_fetch'] = Time.now
47
+ @@scopes_cached[rendering_id] = permissions['data']['renderings'][rendering_id]
48
+ @@scopes_cached[rendering_id]['last_fetch'] = Time.now
52
49
  } if permissions['data']['renderings']
53
50
  end
54
51
 
@@ -62,6 +59,8 @@ module ForestLiana
62
59
  return stat_with_parameters_allowed?
63
60
  end
64
61
 
62
+
63
+
65
64
  if permissions && permissions[@collection_name] &&
66
65
  permissions[@collection_name]['collection']
67
66
  if @permission_name === 'actions'
@@ -84,25 +83,21 @@ module ForestLiana
84
83
  end
85
84
 
86
85
  def get_scope_in_permissions
87
- @@renderings_cached[@rendering_id] &&
88
- @@renderings_cached[@rendering_id][@collection_name] &&
89
- @@renderings_cached[@rendering_id][@collection_name]['scope']
86
+ @@scopes_cached[@rendering_id] &&
87
+ @@scopes_cached[@rendering_id][@collection_name] &&
88
+ @@scopes_cached[@rendering_id][@collection_name]['scope']
90
89
  end
91
90
 
92
91
  def scope_cache_expired?
93
- return true unless @@renderings_cached[@rendering_id] && @@renderings_cached[@rendering_id]['last_fetch']
92
+ return true unless @@scopes_cached[@rendering_id] && @@scopes_cached[@rendering_id]['last_fetch']
94
93
 
95
- elapsed_seconds = date_difference_in_seconds(Time.now, @@renderings_cached[@rendering_id]['last_fetch'])
94
+ elapsed_seconds = date_difference_in_seconds(Time.now, @@scopes_cached[@rendering_id]['last_fetch'])
96
95
  elapsed_seconds >= @@expiration_in_seconds
97
96
  end
98
97
 
99
98
  # This will happen only on rolesACLActivated (as scope cache will always be up to date on disabled)
100
99
  def refresh_scope_cache
101
100
  permissions = ForestLiana::PermissionsGetter::get_permissions_for_rendering(@rendering_id, rendering_specific_only: true)
102
-
103
- # NOTICE: Add stats permissions to the RenderingPermissions
104
- permissions['data']['renderings'][@rendering_id]['stats'] = permissions['stats']
105
-
106
101
  add_scopes_to_cache(permissions)
107
102
  end
108
103
 
@@ -117,12 +112,12 @@ module ForestLiana
117
112
  end
118
113
 
119
114
  def get_live_query_permissions_content
120
- permissions = @@renderings_cached[@rendering_id]
115
+ permissions = get_permissions
121
116
  permissions && permissions['stats'] && permissions['stats']['queries']
122
117
  end
123
118
 
124
119
  def get_stat_with_parameters_content(statPermissionType)
125
- permissions = @@renderings_cached[@rendering_id]
120
+ permissions = get_permissions
126
121
  permissions && permissions['stats'] && permissions['stats'][statPermissionType]
127
122
  end
128
123
 
@@ -182,7 +177,7 @@ module ForestLiana
182
177
  return false unless pool_permissions
183
178
 
184
179
  # NOTICE: equivalent to Object.values in js & removes nil values
185
- array_permission_infos = @query_request_info.values.select{ |x| !x.nil? }
180
+ array_permission_infos = @query_request_info.values.filter_map{ |x| x unless x.nil? }
186
181
 
187
182
  # NOTICE: Is there any pool_permissions containing the array_permission_infos
188
183
  return pool_permissions.any? {
@@ -206,7 +201,7 @@ module ForestLiana
206
201
  # Used only for testing purpose
207
202
  def self.empty_cache
208
203
  @@permissions_cached = Hash.new
209
- @@renderings_cached = Hash.new
204
+ @@scopes_cached = Hash.new
210
205
  @@roles_acl_activated = false
211
206
  @@expiration_in_seconds = (ENV['FOREST_PERMISSIONS_EXPIRATION_IN_SECONDS'] || 3600).to_i
212
207
  end
@@ -19,7 +19,6 @@ module ForestLiana
19
19
  first_name: user['first_name'],
20
20
  last_name: user['last_name'],
21
21
  team: user['teams'][0],
22
- role: user['role'],
23
22
  rendering_id: rendering_id,
24
23
  exp: expiration_in_seconds()
25
24
  }, ForestLiana.auth_secret, 'HS256')
@@ -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.endpoint}" == endpoint) && action.http_method == http_method }
9
+ collection.actions.find { |action| action.endpoint == endpoint && action.http_method == http_method }
10
10
  end
11
11
  end
12
12
  end
@@ -139,7 +139,7 @@ module ForestLiana
139
139
 
140
140
  # Monkey patch the find_serializer_class_name method to specify the
141
141
  # good serializer to use.
142
- ::JSONAPI::Serializer.class_eval do
142
+ ::ForestAdmin::JSONAPI::Serializer.class_eval do
143
143
  def self.find_serializer_class_name(record, options)
144
144
  if record.respond_to?(:jsonapi_serializer_class_name)
145
145
  record.jsonapi_serializer_class_name.to_s
@@ -203,12 +203,10 @@ module ForestLiana
203
203
 
204
204
  def setup_forest_liana_meta
205
205
  ForestLiana.meta = {
206
+ database_type: database_type,
206
207
  liana: 'forest-rails',
207
208
  liana_version: ForestLiana::VERSION,
208
- stack: {
209
- database_type: database_type,
210
- orm_version: Gem.loaded_specs["activerecord"].version.version,
211
- }
209
+ orm_version: Gem.loaded_specs["activerecord"].version.version
212
210
  }
213
211
  end
214
212
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "6.6.2"
2
+ VERSION = "7.0.0.beta.1"
3
3
  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],"role":"Test"}}}'
48
+ response = '{"data":{"id":666,"attributes":{"first_name":"Alice","last_name":"Doe","email":"alice@forestadmin.com","teams":[1,2,3]}}}'
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,7 +72,6 @@ describe "Authentications", type: :request do
72
72
  "first_name" => 'Alice',
73
73
  "last_name" => 'Doe',
74
74
  "team" => 1,
75
- "role" => "Test",
76
75
  }
77
76
 
78
77
  expect(decoded).to include(expected_token_data)
@@ -4,11 +4,9 @@ module ForestLiana
4
4
  context 'on a disordered apimap' do
5
5
  apimap = {
6
6
  'meta': {
7
- stack: {
8
- 'orm_version': '4.34.9',
9
- 'database_type': 'postgresql',
10
- },
7
+ 'orm_version': '4.34.9',
11
8
  'liana_version': '1.5.24',
9
+ 'database_type': 'postgresql',
12
10
  liana: 'forest-rails',
13
11
  },
14
12
  'data': [{
@@ -167,8 +165,8 @@ module ForestLiana
167
165
  end
168
166
 
169
167
  it 'should sort the meta values' do
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'])
168
+ expect(apimap_sorted['meta'].keys).to eq(
169
+ ['database_type', 'liana', 'liana_version', 'orm_version'])
172
170
  end
173
171
  end
174
172
  end
@@ -50,8 +50,7 @@ module ForestLiana
50
50
  })
51
51
  ]
52
52
  }
53
- let(:default_rendering_id) { 1 }
54
- let(:scope_permissions) { { default_rendering_id => { 'scopes' => nil } } }
53
+ let(:scope_permissions) { nil }
55
54
  let(:default_api_permissions) {
56
55
  {
57
56
  "data" => {
@@ -119,14 +118,12 @@ module ForestLiana
119
118
  },
120
119
  'renderings' => scope_permissions
121
120
  },
122
- "stats" => {
123
- "queries"=>[],
124
- },
125
121
  "meta" => {
126
122
  "rolesACLActivated" => true
127
123
  }
128
124
  }
129
125
  }
126
+ let(:default_rendering_id) { 1 }
130
127
 
131
128
  before do
132
129
  allow(ForestLiana).to receive(:apimap).and_return(schema)
@@ -371,12 +368,9 @@ module ForestLiana
371
368
  "data" => {
372
369
  'collections' => { },
373
370
  'renderings' => {
374
- other_rendering_id => { 'custom' => nil }
371
+ '2' => { 'custom' => nil }
375
372
  }
376
373
  },
377
- "stats" => {
378
- "somestats" => [],
379
- },
380
374
  "meta" => {
381
375
  "rolesACLActivated" => true
382
376
  }
@@ -20,8 +20,7 @@ module ForestLiana
20
20
  })
21
21
  ]
22
22
  }
23
- let(:default_rendering_id) { 1 }
24
- let(:scope_permissions) { { default_rendering_id => { 'scopes' => nil } } }
23
+ let(:scope_permissions) { nil }
25
24
  let(:default_api_permissions) {
26
25
  {
27
26
  "data" => {
@@ -62,6 +61,7 @@ module ForestLiana
62
61
  },
63
62
  }
64
63
  }
64
+ let(:default_rendering_id) { 1 }
65
65
 
66
66
  before do
67
67
  allow(ForestLiana).to receive(:apimap).and_return(schema)
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.6.2
4
+ version: 7.0.0.beta.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-06-16 00:00:00.000000000 Z
11
+ date: 2021-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: jsonapi-serializers
28
+ name: forestadmin-jsonapi-serializers
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -371,7 +371,6 @@ 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
375
374
  - spec/rails_helper.rb
376
375
  - spec/requests/actions_controller_spec.rb
377
376
  - spec/requests/authentications_spec.rb
@@ -496,177 +495,176 @@ required_ruby_version: !ruby/object:Gem::Requirement
496
495
  version: '0'
497
496
  required_rubygems_version: !ruby/object:Gem::Requirement
498
497
  requirements:
499
- - - ">="
498
+ - - ">"
500
499
  - !ruby/object:Gem::Version
501
- version: '0'
500
+ version: 1.3.1
502
501
  requirements: []
503
502
  rubygems_version: 3.1.2
504
503
  signing_key:
505
504
  specification_version: 4
506
505
  summary: Official Rails Liana for Forest
507
506
  test_files:
507
+ - test/forest_liana_test.rb
508
+ - test/test_helper.rb
509
+ - test/services/forest_liana/has_many_getter_test.rb
510
+ - test/services/forest_liana/pie_stat_getter_test.rb
511
+ - test/services/forest_liana/resource_updater_test.rb
512
+ - test/services/forest_liana/value_stat_getter_test.rb
513
+ - test/services/forest_liana/scope_validator_test.rb
514
+ - test/services/forest_liana/schema_adapter_test.rb
515
+ - test/services/forest_liana/operator_date_interval_parser_test.rb
508
516
  - test/routing/route_test.rb
517
+ - test/fixtures/string_field.yml
518
+ - test/fixtures/serialize_field.yml
519
+ - test/fixtures/has_one_field.yml
520
+ - test/fixtures/has_many_through_field.yml
521
+ - test/fixtures/has_many_field.yml
522
+ - test/fixtures/reference.yml
523
+ - test/fixtures/owner.yml
524
+ - test/fixtures/belongs_to_field.yml
525
+ - test/fixtures/tree.yml
526
+ - test/dummy/db/schema.rb
527
+ - test/dummy/db/migrate/20150608131610_create_float_field.rb
528
+ - test/dummy/db/migrate/20150608131430_create_integer_field.rb
529
+ - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
530
+ - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
531
+ - test/dummy/db/migrate/20150608130516_create_date_field.rb
532
+ - test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
533
+ - test/dummy/db/migrate/20150608132621_create_string_field.rb
534
+ - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
535
+ - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
536
+ - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
537
+ - test/dummy/db/migrate/20181111162121_create_references_table.rb
538
+ - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
539
+ - test/dummy/db/migrate/20160627172810_create_owner.rb
540
+ - test/dummy/db/migrate/20160627172951_create_tree.rb
541
+ - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
542
+ - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
543
+ - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
544
+ - test/dummy/db/migrate/20160628173505_add_timestamps.rb
545
+ - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
546
+ - test/dummy/config.ru
547
+ - test/dummy/bin/rake
509
548
  - test/dummy/bin/setup
510
- - test/dummy/bin/rails
511
549
  - test/dummy/bin/bundle
512
- - test/dummy/bin/rake
513
- - test/dummy/README.rdoc
550
+ - test/dummy/bin/rails
514
551
  - test/dummy/config/routes.rb
515
- - test/dummy/config/database.yml
516
- - test/dummy/config/environment.rb
517
- - test/dummy/config/locales/en.yml
518
- - test/dummy/config/application.rb
519
- - test/dummy/config/secrets.yml
520
- - test/dummy/config/initializers/wrap_parameters.rb
521
- - test/dummy/config/initializers/filter_parameter_logging.rb
552
+ - test/dummy/config/boot.rb
522
553
  - test/dummy/config/initializers/mime_types.rb
523
- - test/dummy/config/initializers/inflections.rb
524
- - test/dummy/config/initializers/session_store.rb
525
554
  - test/dummy/config/initializers/assets.rb
526
- - test/dummy/config/initializers/backtrace_silencers.rb
555
+ - test/dummy/config/initializers/session_store.rb
556
+ - test/dummy/config/initializers/wrap_parameters.rb
557
+ - test/dummy/config/initializers/filter_parameter_logging.rb
527
558
  - test/dummy/config/initializers/cookies_serializer.rb
528
- - test/dummy/config/environments/development.rb
559
+ - test/dummy/config/initializers/backtrace_silencers.rb
560
+ - test/dummy/config/initializers/inflections.rb
561
+ - test/dummy/config/locales/en.yml
562
+ - test/dummy/config/secrets.yml
563
+ - test/dummy/config/environment.rb
529
564
  - test/dummy/config/environments/production.rb
565
+ - test/dummy/config/environments/development.rb
530
566
  - test/dummy/config/environments/test.rb
531
- - test/dummy/config/boot.rb
532
- - test/dummy/app/models/polymorphic_field.rb
533
- - test/dummy/app/models/date_field.rb
534
- - test/dummy/app/models/integer_field.rb
535
- - test/dummy/app/models/serialize_field.rb
536
- - test/dummy/app/models/float_field.rb
567
+ - test/dummy/config/database.yml
568
+ - test/dummy/config/application.rb
569
+ - test/dummy/README.rdoc
570
+ - test/dummy/Rakefile
571
+ - test/dummy/public/favicon.ico
572
+ - test/dummy/public/404.html
573
+ - test/dummy/public/422.html
574
+ - test/dummy/public/500.html
575
+ - test/dummy/app/controllers/application_controller.rb
576
+ - test/dummy/app/views/layouts/application.html.erb
577
+ - test/dummy/app/helpers/application_helper.rb
578
+ - test/dummy/app/assets/stylesheets/application.css
579
+ - test/dummy/app/assets/config/manifest.js
580
+ - test/dummy/app/assets/javascripts/application.js
537
581
  - test/dummy/app/models/boolean_field.rb
538
- - test/dummy/app/models/has_many_field.rb
582
+ - test/dummy/app/models/decimal_field.rb
583
+ - test/dummy/app/models/date_field.rb
539
584
  - test/dummy/app/models/tree.rb
540
- - test/dummy/app/models/has_many_class_name_field.rb
541
- - test/dummy/app/models/string_field.rb
542
- - test/dummy/app/models/owner.rb
543
585
  - test/dummy/app/models/has_and_belongs_to_many_field.rb
586
+ - test/dummy/app/models/owner.rb
544
587
  - test/dummy/app/models/belongs_to_class_name_field.rb
545
588
  - test/dummy/app/models/has_many_through_field.rb
546
- - test/dummy/app/models/decimal_field.rb
547
- - test/dummy/app/models/reference.rb
548
- - test/dummy/app/models/belongs_to_field.rb
589
+ - test/dummy/app/models/float_field.rb
590
+ - test/dummy/app/models/polymorphic_field.rb
549
591
  - test/dummy/app/models/has_one_field.rb
550
- - test/dummy/app/controllers/application_controller.rb
551
- - test/dummy/app/assets/config/manifest.js
552
- - test/dummy/app/assets/javascripts/application.js
553
- - test/dummy/app/assets/stylesheets/application.css
554
- - test/dummy/app/views/layouts/application.html.erb
555
- - test/dummy/app/helpers/application_helper.rb
556
- - test/dummy/config.ru
557
- - test/dummy/public/favicon.ico
558
- - test/dummy/public/500.html
559
- - test/dummy/public/422.html
560
- - test/dummy/public/404.html
561
- - test/dummy/db/migrate/20150608132621_create_string_field.rb
562
- - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
563
- - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
564
- - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
565
- - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
566
- - test/dummy/db/migrate/20160627172951_create_tree.rb
567
- - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
568
- - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
569
- - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
570
- - test/dummy/db/migrate/20150608130516_create_date_field.rb
571
- - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
572
- - test/dummy/db/migrate/20150608131430_create_integer_field.rb
573
- - test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
574
- - test/dummy/db/migrate/20160628173505_add_timestamps.rb
575
- - test/dummy/db/migrate/20160627172810_create_owner.rb
576
- - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
577
- - test/dummy/db/migrate/20181111162121_create_references_table.rb
578
- - test/dummy/db/migrate/20150608131610_create_float_field.rb
579
- - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
580
- - test/dummy/db/schema.rb
581
- - test/dummy/Rakefile
582
- - test/test_helper.rb
583
- - test/forest_liana_test.rb
584
- - test/services/forest_liana/has_many_getter_test.rb
585
- - test/services/forest_liana/value_stat_getter_test.rb
586
- - test/services/forest_liana/pie_stat_getter_test.rb
587
- - test/services/forest_liana/operator_date_interval_parser_test.rb
588
- - test/services/forest_liana/schema_adapter_test.rb
589
- - test/services/forest_liana/resource_updater_test.rb
590
- - test/services/forest_liana/scope_validator_test.rb
591
- - test/fixtures/belongs_to_field.yml
592
- - test/fixtures/tree.yml
593
- - test/fixtures/has_one_field.yml
594
- - test/fixtures/has_many_through_field.yml
595
- - test/fixtures/reference.yml
596
- - test/fixtures/serialize_field.yml
597
- - test/fixtures/has_many_field.yml
598
- - test/fixtures/owner.yml
599
- - test/fixtures/string_field.yml
600
- - spec/requests/actions_controller_spec.rb
601
- - spec/requests/stats_spec.rb
602
- - spec/requests/authentications_spec.rb
603
- - spec/requests/resources_spec.rb
604
- - spec/config/initializers/logger_spec.rb
592
+ - test/dummy/app/models/has_many_class_name_field.rb
593
+ - test/dummy/app/models/belongs_to_field.rb
594
+ - test/dummy/app/models/integer_field.rb
595
+ - test/dummy/app/models/serialize_field.rb
596
+ - test/dummy/app/models/string_field.rb
597
+ - test/dummy/app/models/has_many_field.rb
598
+ - test/dummy/app/models/reference.rb
605
599
  - spec/spec_helper.rb
600
+ - spec/services/forest_liana/permissions_getter_spec.rb
601
+ - spec/services/forest_liana/resources_getter_spec.rb
602
+ - spec/services/forest_liana/ip_whitelist_checker_spec.rb
603
+ - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
604
+ - spec/services/forest_liana/filters_parser_spec.rb
605
+ - spec/services/forest_liana/schema_adapter_spec.rb
606
+ - spec/services/forest_liana/line_stat_getter_spec.rb
607
+ - spec/services/forest_liana/permissions_formatter_spec.rb
608
+ - spec/services/forest_liana/permissions_checker_live_queries_spec.rb
609
+ - spec/services/forest_liana/apimap_sorter_spec.rb
610
+ - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
611
+ - spec/config/initializers/logger_spec.rb
612
+ - spec/helpers/forest_liana/is_same_data_structure_helper_spec.rb
613
+ - spec/helpers/forest_liana/schema_helper_spec.rb
614
+ - spec/helpers/forest_liana/query_helper_spec.rb
615
+ - spec/dummy/db/schema.rb
616
+ - spec/dummy/db/migrate/20190226172951_create_user.rb
617
+ - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
618
+ - spec/dummy/db/migrate/20190226173051_create_isle.rb
619
+ - spec/dummy/db/migrate/20210511141752_create_owners.rb
620
+ - spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
621
+ - spec/dummy/db/migrate/20210326140855_create_locations.rb
622
+ - spec/dummy/db/migrate/20190226174951_create_tree.rb
623
+ - spec/dummy/db/migrate/20210526084712_create_products.rb
624
+ - spec/dummy/db/migrate/20210326110524_create_references.rb
625
+ - spec/dummy/config.ru
626
+ - spec/dummy/bin/rake
606
627
  - spec/dummy/bin/setup
607
- - spec/dummy/bin/rails
608
628
  - spec/dummy/bin/bundle
609
- - spec/dummy/bin/rake
610
- - spec/dummy/README.rdoc
629
+ - spec/dummy/bin/rails
611
630
  - spec/dummy/config/routes.rb
612
- - spec/dummy/config/database.yml
613
- - spec/dummy/config/environment.rb
614
- - spec/dummy/config/application.rb
615
- - spec/dummy/config/secrets.yml
616
- - spec/dummy/config/initializers/wrap_parameters.rb
617
- - spec/dummy/config/initializers/filter_parameter_logging.rb
618
- - spec/dummy/config/initializers/mime_types.rb
631
+ - spec/dummy/config/boot.rb
619
632
  - spec/dummy/config/initializers/forest_liana.rb
620
- - spec/dummy/config/initializers/inflections.rb
621
- - spec/dummy/config/initializers/session_store.rb
633
+ - spec/dummy/config/initializers/mime_types.rb
622
634
  - spec/dummy/config/initializers/assets.rb
623
- - spec/dummy/config/initializers/backtrace_silencers.rb
635
+ - spec/dummy/config/initializers/session_store.rb
636
+ - spec/dummy/config/initializers/wrap_parameters.rb
637
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
624
638
  - spec/dummy/config/initializers/cookies_serializer.rb
625
- - spec/dummy/config/environments/development.rb
639
+ - spec/dummy/config/initializers/backtrace_silencers.rb
640
+ - spec/dummy/config/initializers/inflections.rb
641
+ - spec/dummy/config/secrets.yml
642
+ - spec/dummy/config/environment.rb
626
643
  - spec/dummy/config/environments/production.rb
644
+ - spec/dummy/config/environments/development.rb
627
645
  - spec/dummy/config/environments/test.rb
628
- - spec/dummy/config/boot.rb
629
- - spec/dummy/app/models/island.rb
630
- - spec/dummy/app/models/location.rb
631
- - spec/dummy/app/models/product.rb
646
+ - spec/dummy/config/database.yml
647
+ - spec/dummy/config/application.rb
648
+ - spec/dummy/lib/forest_liana/collections/user.rb
649
+ - spec/dummy/lib/forest_liana/collections/location.rb
650
+ - spec/dummy/README.rdoc
651
+ - spec/dummy/Rakefile
652
+ - spec/dummy/app/controllers/application_controller.rb
653
+ - spec/dummy/app/views/layouts/application.html.erb
654
+ - spec/dummy/app/config/routes.rb
655
+ - spec/dummy/app/helpers/application_helper.rb
656
+ - spec/dummy/app/assets/stylesheets/application.css
657
+ - spec/dummy/app/assets/config/manifest.js
658
+ - spec/dummy/app/assets/javascripts/application.js
632
659
  - spec/dummy/app/models/tree.rb
633
660
  - spec/dummy/app/models/owner.rb
634
661
  - spec/dummy/app/models/user.rb
662
+ - spec/dummy/app/models/product.rb
663
+ - spec/dummy/app/models/location.rb
664
+ - spec/dummy/app/models/island.rb
635
665
  - spec/dummy/app/models/reference.rb
636
- - spec/dummy/app/config/routes.rb
637
- - spec/dummy/app/controllers/application_controller.rb
638
- - spec/dummy/app/assets/config/manifest.js
639
- - spec/dummy/app/assets/javascripts/application.js
640
- - spec/dummy/app/assets/stylesheets/application.css
641
- - spec/dummy/app/views/layouts/application.html.erb
642
- - spec/dummy/app/helpers/application_helper.rb
643
- - spec/dummy/config.ru
644
- - spec/dummy/lib/forest_liana/collections/location.rb
645
- - spec/dummy/lib/forest_liana/collections/user.rb
646
- - spec/dummy/db/migrate/20190226173051_create_isle.rb
647
- - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
648
- - spec/dummy/db/migrate/20210326110524_create_references.rb
649
- - spec/dummy/db/migrate/20210526084712_create_products.rb
650
- - spec/dummy/db/migrate/20190226172951_create_user.rb
651
- - spec/dummy/db/migrate/20210326140855_create_locations.rb
652
- - spec/dummy/db/migrate/20210511141752_create_owners.rb
653
- - spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
654
- - spec/dummy/db/migrate/20190226174951_create_tree.rb
655
- - spec/dummy/db/schema.rb
656
- - spec/dummy/Rakefile
657
- - spec/lib/forest_liana/bootstrapper_spec.rb
658
- - spec/services/forest_liana/ip_whitelist_checker_spec.rb
659
- - spec/services/forest_liana/resources_getter_spec.rb
660
- - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
661
- - spec/services/forest_liana/permissions_formatter_spec.rb
662
- - spec/services/forest_liana/filters_parser_spec.rb
663
- - spec/services/forest_liana/line_stat_getter_spec.rb
664
- - spec/services/forest_liana/apimap_sorter_spec.rb
665
- - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
666
- - spec/services/forest_liana/permissions_getter_spec.rb
667
- - spec/services/forest_liana/schema_adapter_spec.rb
668
- - spec/services/forest_liana/permissions_checker_live_queries_spec.rb
669
- - spec/helpers/forest_liana/schema_helper_spec.rb
670
- - spec/helpers/forest_liana/query_helper_spec.rb
671
- - spec/helpers/forest_liana/is_same_data_structure_helper_spec.rb
672
666
  - spec/rails_helper.rb
667
+ - spec/requests/stats_spec.rb
668
+ - spec/requests/resources_spec.rb
669
+ - spec/requests/actions_controller_spec.rb
670
+ - spec/requests/authentications_spec.rb
@@ -1,12 +0,0 @@
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