forest_liana 6.6.3 → 7.0.0.beta.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.
Files changed (30) 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 +136 -139
  29. data/config/initializers/httpclient.rb +0 -11
  30. 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: a929f85740648eb3b0e0ec75a4a863f67615ba3ec409916357834886ef25bffe
4
- data.tar.gz: c0c4dd8ab19ddf1d3a5b61a119d52169a2dac491867152cb5db473c1500d409e
3
+ metadata.gz: 69b23785cf391fb245efbf6488e58fb19bbbc010e9dac0a91574412684e89129
4
+ data.tar.gz: 26d9dd7b466009b8a09182dec02778b729e58b83c7b717811c45dca5ce6cc032
5
5
  SHA512:
6
- metadata.gz: be22f9c95d02840c5f759eab0d771b948532bf9d032c32d730b4718e7235ce2c09eb6f381af4c715ede972f8f39cef311491bcea6f3b998e5d0c197e09ef620c
7
- data.tar.gz: e7d9237d50e7be63776c9c4fdf309f6d3ab5fe6c9c0e468fdd71c9174701b7baba8237c882cff6c079efec043922ca234a3b9dc3c51b7bf2272454b2847efed7
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.3"
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.3
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-09-30 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
  - - ">="
@@ -301,7 +301,6 @@ files:
301
301
  - config/initializers/arel-helpers.rb
302
302
  - config/initializers/error-messages.rb
303
303
  - config/initializers/errors.rb
304
- - config/initializers/httpclient.rb
305
304
  - config/initializers/logger.rb
306
305
  - config/initializers/time_formats.rb
307
306
  - config/routes.rb
@@ -372,7 +371,6 @@ files:
372
371
  - spec/helpers/forest_liana/is_same_data_structure_helper_spec.rb
373
372
  - spec/helpers/forest_liana/query_helper_spec.rb
374
373
  - spec/helpers/forest_liana/schema_helper_spec.rb
375
- - spec/lib/forest_liana/bootstrapper_spec.rb
376
374
  - spec/rails_helper.rb
377
375
  - spec/requests/actions_controller_spec.rb
378
376
  - spec/requests/authentications_spec.rb
@@ -497,177 +495,176 @@ required_ruby_version: !ruby/object:Gem::Requirement
497
495
  version: '0'
498
496
  required_rubygems_version: !ruby/object:Gem::Requirement
499
497
  requirements:
500
- - - ">="
498
+ - - ">"
501
499
  - !ruby/object:Gem::Version
502
- version: '0'
500
+ version: 1.3.1
503
501
  requirements: []
504
502
  rubygems_version: 3.1.2
505
503
  signing_key:
506
504
  specification_version: 4
507
505
  summary: Official Rails Liana for Forest
508
506
  test_files:
509
- - test/routing/route_test.rb
510
507
  - test/forest_liana_test.rb
511
- - test/fixtures/belongs_to_field.yml
512
- - test/fixtures/owner.yml
513
- - test/fixtures/has_one_field.yml
514
- - test/fixtures/serialize_field.yml
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
516
+ - test/routing/route_test.rb
515
517
  - test/fixtures/string_field.yml
518
+ - test/fixtures/serialize_field.yml
519
+ - test/fixtures/has_one_field.yml
516
520
  - test/fixtures/has_many_through_field.yml
517
- - test/fixtures/reference.yml
518
521
  - test/fixtures/has_many_field.yml
522
+ - test/fixtures/reference.yml
523
+ - test/fixtures/owner.yml
524
+ - test/fixtures/belongs_to_field.yml
519
525
  - test/fixtures/tree.yml
520
- - test/dummy/README.rdoc
521
- - test/dummy/public/404.html
522
- - test/dummy/public/422.html
523
- - test/dummy/public/500.html
524
- - test/dummy/public/favicon.ico
525
- - test/dummy/Rakefile
526
- - test/dummy/config/application.rb
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
548
+ - test/dummy/bin/setup
549
+ - test/dummy/bin/bundle
550
+ - test/dummy/bin/rails
527
551
  - test/dummy/config/routes.rb
528
- - test/dummy/config/environments/production.rb
529
- - test/dummy/config/environments/test.rb
530
- - test/dummy/config/environments/development.rb
531
- - test/dummy/config/database.yml
532
- - test/dummy/config/initializers/backtrace_silencers.rb
552
+ - test/dummy/config/boot.rb
553
+ - test/dummy/config/initializers/mime_types.rb
533
554
  - test/dummy/config/initializers/assets.rb
555
+ - test/dummy/config/initializers/session_store.rb
534
556
  - test/dummy/config/initializers/wrap_parameters.rb
535
557
  - test/dummy/config/initializers/filter_parameter_logging.rb
536
- - test/dummy/config/initializers/session_store.rb
537
- - test/dummy/config/initializers/inflections.rb
538
- - test/dummy/config/initializers/mime_types.rb
539
558
  - test/dummy/config/initializers/cookies_serializer.rb
559
+ - test/dummy/config/initializers/backtrace_silencers.rb
560
+ - test/dummy/config/initializers/inflections.rb
540
561
  - test/dummy/config/locales/en.yml
541
- - test/dummy/config/environment.rb
542
562
  - test/dummy/config/secrets.yml
543
- - test/dummy/config/boot.rb
544
- - test/dummy/app/models/has_many_through_field.rb
545
- - test/dummy/app/models/tree.rb
546
- - test/dummy/app/models/belongs_to_field.rb
547
- - test/dummy/app/models/belongs_to_class_name_field.rb
548
- - test/dummy/app/models/polymorphic_field.rb
549
- - test/dummy/app/models/reference.rb
550
- - test/dummy/app/models/date_field.rb
551
- - test/dummy/app/models/decimal_field.rb
552
- - test/dummy/app/models/owner.rb
553
- - test/dummy/app/models/has_many_field.rb
563
+ - test/dummy/config/environment.rb
564
+ - test/dummy/config/environments/production.rb
565
+ - test/dummy/config/environments/development.rb
566
+ - test/dummy/config/environments/test.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
554
581
  - test/dummy/app/models/boolean_field.rb
582
+ - test/dummy/app/models/decimal_field.rb
583
+ - test/dummy/app/models/date_field.rb
584
+ - test/dummy/app/models/tree.rb
555
585
  - test/dummy/app/models/has_and_belongs_to_many_field.rb
556
- - test/dummy/app/models/serialize_field.rb
557
- - test/dummy/app/models/integer_field.rb
586
+ - test/dummy/app/models/owner.rb
587
+ - test/dummy/app/models/belongs_to_class_name_field.rb
588
+ - test/dummy/app/models/has_many_through_field.rb
558
589
  - test/dummy/app/models/float_field.rb
590
+ - test/dummy/app/models/polymorphic_field.rb
591
+ - test/dummy/app/models/has_one_field.rb
559
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
560
596
  - test/dummy/app/models/string_field.rb
561
- - test/dummy/app/models/has_one_field.rb
562
- - test/dummy/app/views/layouts/application.html.erb
563
- - test/dummy/app/assets/javascripts/application.js
564
- - test/dummy/app/assets/stylesheets/application.css
565
- - test/dummy/app/assets/config/manifest.js
566
- - test/dummy/app/controllers/application_controller.rb
567
- - test/dummy/app/helpers/application_helper.rb
568
- - test/dummy/config.ru
569
- - test/dummy/db/migrate/20150608131603_create_decimal_field.rb
570
- - test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
571
- - test/dummy/db/migrate/20160628173505_add_timestamps.rb
572
- - test/dummy/db/migrate/20181111162121_create_references_table.rb
573
- - test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
574
- - test/dummy/db/migrate/20150608131610_create_float_field.rb
575
- - test/dummy/db/migrate/20160627172951_create_tree.rb
576
- - test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
577
- - test/dummy/db/migrate/20150608132159_create_boolean_field.rb
578
- - test/dummy/db/migrate/20150608131430_create_integer_field.rb
579
- - test/dummy/db/migrate/20150608133044_create_has_one_field.rb
580
- - test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
581
- - test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
582
- - test/dummy/db/migrate/20150608130516_create_date_field.rb
583
- - test/dummy/db/migrate/20170614141921_create_serialize_field.rb
584
- - test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
585
- - test/dummy/db/migrate/20150608150016_create_has_many_field.rb
586
- - test/dummy/db/migrate/20160627172810_create_owner.rb
587
- - test/dummy/db/migrate/20150608132621_create_string_field.rb
588
- - test/dummy/db/schema.rb
589
- - test/dummy/bin/rails
590
- - test/dummy/bin/rake
591
- - test/dummy/bin/bundle
592
- - test/dummy/bin/setup
593
- - test/services/forest_liana/pie_stat_getter_test.rb
594
- - test/services/forest_liana/value_stat_getter_test.rb
595
- - test/services/forest_liana/operator_date_interval_parser_test.rb
596
- - test/services/forest_liana/schema_adapter_test.rb
597
- - test/services/forest_liana/resource_updater_test.rb
598
- - test/services/forest_liana/has_many_getter_test.rb
599
- - test/services/forest_liana/scope_validator_test.rb
600
- - test/test_helper.rb
597
+ - test/dummy/app/models/has_many_field.rb
598
+ - test/dummy/app/models/reference.rb
601
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
602
611
  - spec/config/initializers/logger_spec.rb
603
- - spec/lib/forest_liana/bootstrapper_spec.rb
604
- - spec/rails_helper.rb
605
- - spec/dummy/README.rdoc
606
- - spec/dummy/Rakefile
607
- - spec/dummy/config/application.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
627
+ - spec/dummy/bin/setup
628
+ - spec/dummy/bin/bundle
629
+ - spec/dummy/bin/rails
608
630
  - spec/dummy/config/routes.rb
609
- - spec/dummy/config/environments/production.rb
610
- - spec/dummy/config/environments/test.rb
611
- - spec/dummy/config/environments/development.rb
612
- - spec/dummy/config/database.yml
613
- - spec/dummy/config/initializers/backtrace_silencers.rb
631
+ - spec/dummy/config/boot.rb
632
+ - spec/dummy/config/initializers/forest_liana.rb
633
+ - spec/dummy/config/initializers/mime_types.rb
614
634
  - spec/dummy/config/initializers/assets.rb
635
+ - spec/dummy/config/initializers/session_store.rb
615
636
  - spec/dummy/config/initializers/wrap_parameters.rb
616
637
  - spec/dummy/config/initializers/filter_parameter_logging.rb
617
- - spec/dummy/config/initializers/session_store.rb
618
- - spec/dummy/config/initializers/forest_liana.rb
619
- - spec/dummy/config/initializers/inflections.rb
620
- - spec/dummy/config/initializers/mime_types.rb
621
638
  - spec/dummy/config/initializers/cookies_serializer.rb
622
- - spec/dummy/config/environment.rb
639
+ - spec/dummy/config/initializers/backtrace_silencers.rb
640
+ - spec/dummy/config/initializers/inflections.rb
623
641
  - spec/dummy/config/secrets.yml
624
- - spec/dummy/config/boot.rb
642
+ - spec/dummy/config/environment.rb
643
+ - spec/dummy/config/environments/production.rb
644
+ - spec/dummy/config/environments/development.rb
645
+ - spec/dummy/config/environments/test.rb
646
+ - spec/dummy/config/database.yml
647
+ - spec/dummy/config/application.rb
625
648
  - spec/dummy/lib/forest_liana/collections/user.rb
626
649
  - spec/dummy/lib/forest_liana/collections/location.rb
627
- - spec/dummy/app/models/tree.rb
628
- - spec/dummy/app/models/island.rb
629
- - spec/dummy/app/models/reference.rb
630
- - spec/dummy/app/models/owner.rb
631
- - spec/dummy/app/models/product.rb
632
- - spec/dummy/app/models/user.rb
633
- - spec/dummy/app/models/location.rb
650
+ - spec/dummy/README.rdoc
651
+ - spec/dummy/Rakefile
652
+ - spec/dummy/app/controllers/application_controller.rb
634
653
  - spec/dummy/app/views/layouts/application.html.erb
635
654
  - spec/dummy/app/config/routes.rb
636
- - spec/dummy/app/assets/javascripts/application.js
655
+ - spec/dummy/app/helpers/application_helper.rb
637
656
  - spec/dummy/app/assets/stylesheets/application.css
638
657
  - spec/dummy/app/assets/config/manifest.js
639
- - spec/dummy/app/controllers/application_controller.rb
640
- - spec/dummy/app/helpers/application_helper.rb
641
- - spec/dummy/config.ru
642
- - spec/dummy/db/migrate/20190226173051_create_isle.rb
643
- - spec/dummy/db/migrate/20190226172951_create_user.rb
644
- - spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
645
- - spec/dummy/db/migrate/20210326110524_create_references.rb
646
- - spec/dummy/db/migrate/20190226174951_create_tree.rb
647
- - spec/dummy/db/migrate/20210526084712_create_products.rb
648
- - spec/dummy/db/migrate/20210326140855_create_locations.rb
649
- - spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
650
- - spec/dummy/db/migrate/20210511141752_create_owners.rb
651
- - spec/dummy/db/schema.rb
652
- - spec/dummy/bin/rails
653
- - spec/dummy/bin/rake
654
- - spec/dummy/bin/bundle
655
- - spec/dummy/bin/setup
656
- - spec/services/forest_liana/apimap_sorter_spec.rb
657
- - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
658
- - spec/services/forest_liana/ip_whitelist_checker_spec.rb
659
- - spec/services/forest_liana/permissions_formatter_spec.rb
660
- - spec/services/forest_liana/line_stat_getter_spec.rb
661
- - spec/services/forest_liana/filters_parser_spec.rb
662
- - spec/services/forest_liana/permissions_checker_live_queries_spec.rb
663
- - spec/services/forest_liana/permissions_getter_spec.rb
664
- - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
665
- - spec/services/forest_liana/schema_adapter_spec.rb
666
- - spec/services/forest_liana/resources_getter_spec.rb
667
- - spec/requests/authentications_spec.rb
668
- - spec/requests/actions_controller_spec.rb
658
+ - spec/dummy/app/assets/javascripts/application.js
659
+ - spec/dummy/app/models/tree.rb
660
+ - spec/dummy/app/models/owner.rb
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
665
+ - spec/dummy/app/models/reference.rb
666
+ - spec/rails_helper.rb
669
667
  - spec/requests/stats_spec.rb
670
668
  - spec/requests/resources_spec.rb
671
- - spec/helpers/forest_liana/query_helper_spec.rb
672
- - spec/helpers/forest_liana/is_same_data_structure_helper_spec.rb
673
- - spec/helpers/forest_liana/schema_helper_spec.rb
669
+ - spec/requests/actions_controller_spec.rb
670
+ - spec/requests/authentications_spec.rb
@@ -1,11 +0,0 @@
1
- require 'httpclient'
2
-
3
- class HTTPClient
4
- alias original_initialize initialize
5
-
6
- def initialize(*args, &block)
7
- original_initialize(*args, &block)
8
- # NOTICE: Force use of the default system CA certs (instead of the 6 year old bundled ones).
9
- @session_manager&.ssl_config&.set_default_paths
10
- end
11
- end
@@ -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