forest_liana 5.3.2 → 6.0.0.pre.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/forest_liana/actions_controller.rb +8 -1
  3. data/app/controllers/forest_liana/application_controller.rb +1 -7
  4. data/app/controllers/forest_liana/authentication_controller.rb +122 -0
  5. data/app/controllers/forest_liana/base_controller.rb +4 -0
  6. data/app/controllers/forest_liana/resources_controller.rb +14 -17
  7. data/app/controllers/forest_liana/router.rb +2 -2
  8. data/app/controllers/forest_liana/sessions_controller.rb +1 -1
  9. data/app/controllers/forest_liana/smart_actions_controller.rb +10 -5
  10. data/app/controllers/forest_liana/stats_controller.rb +5 -5
  11. data/app/helpers/forest_liana/adapter_helper.rb +1 -1
  12. data/app/serializers/forest_liana/schema_serializer.rb +2 -2
  13. data/app/services/forest_liana/apimap_sorter.rb +1 -1
  14. data/app/services/forest_liana/authentication.rb +59 -0
  15. data/app/services/forest_liana/authorization_getter.rb +12 -20
  16. data/app/services/forest_liana/forest_api_requester.rb +14 -5
  17. data/app/services/forest_liana/ip_whitelist_checker.rb +1 -1
  18. data/app/services/forest_liana/login_handler.rb +3 -11
  19. data/app/services/forest_liana/oidc_client_manager.rb +34 -0
  20. data/app/services/forest_liana/oidc_configuration_retriever.rb +12 -0
  21. data/app/services/forest_liana/oidc_dynamic_client_registrator.rb +67 -0
  22. data/app/services/forest_liana/permissions_checker.rb +117 -56
  23. data/app/services/forest_liana/permissions_formatter.rb +52 -0
  24. data/app/services/forest_liana/permissions_getter.rb +52 -17
  25. data/app/services/forest_liana/query_stat_getter.rb +5 -5
  26. data/app/services/forest_liana/scope_validator.rb +8 -7
  27. data/app/services/forest_liana/token.rb +27 -0
  28. data/app/services/forest_liana/utils/beta_schema_utils.rb +13 -0
  29. data/config/initializers/error-messages.rb +20 -0
  30. data/config/routes.rb +5 -0
  31. data/lib/forest_liana.rb +1 -0
  32. data/lib/forest_liana/bootstrapper.rb +1 -1
  33. data/lib/forest_liana/collection.rb +2 -2
  34. data/lib/forest_liana/engine.rb +9 -0
  35. data/lib/forest_liana/json_printer.rb +1 -1
  36. data/lib/forest_liana/version.rb +1 -1
  37. data/spec/dummy/app/assets/config/manifest.js +1 -0
  38. data/spec/dummy/config/application.rb +1 -1
  39. data/spec/dummy/config/initializers/forest_liana.rb +1 -0
  40. data/spec/dummy/db/migrate/20190226172951_create_user.rb +1 -1
  41. data/spec/dummy/db/migrate/20190226173051_create_isle.rb +1 -1
  42. data/spec/dummy/db/migrate/20190226174951_create_tree.rb +1 -1
  43. data/spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb +1 -1
  44. data/spec/dummy/db/migrate/20190716135241_add_type_to_user.rb +1 -1
  45. data/spec/dummy/db/schema.rb +18 -20
  46. data/spec/requests/actions_controller_spec.rb +46 -11
  47. data/spec/requests/authentications_spec.rb +105 -0
  48. data/spec/requests/resources_spec.rb +4 -4
  49. data/spec/requests/sessions_spec.rb +53 -0
  50. data/spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb +711 -0
  51. data/spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb +831 -0
  52. data/spec/services/forest_liana/permissions_formatter_spec.rb +222 -0
  53. data/spec/services/forest_liana/permissions_getter_spec.rb +83 -0
  54. data/spec/spec_helper.rb +3 -0
  55. data/test/dummy/app/assets/config/manifest.js +1 -0
  56. data/test/dummy/config/application.rb +1 -1
  57. data/test/dummy/db/migrate/20150608130516_create_date_field.rb +1 -1
  58. data/test/dummy/db/migrate/20150608131430_create_integer_field.rb +1 -1
  59. data/test/dummy/db/migrate/20150608131603_create_decimal_field.rb +1 -1
  60. data/test/dummy/db/migrate/20150608131610_create_float_field.rb +1 -1
  61. data/test/dummy/db/migrate/20150608132159_create_boolean_field.rb +1 -1
  62. data/test/dummy/db/migrate/20150608132621_create_string_field.rb +1 -1
  63. data/test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb +1 -1
  64. data/test/dummy/db/migrate/20150608133044_create_has_one_field.rb +1 -1
  65. data/test/dummy/db/migrate/20150608150016_create_has_many_field.rb +1 -1
  66. data/test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb +1 -1
  67. data/test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb +1 -1
  68. data/test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb +1 -1
  69. data/test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb +1 -1
  70. data/test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb +1 -1
  71. data/test/dummy/db/migrate/20160627172810_create_owner.rb +1 -1
  72. data/test/dummy/db/migrate/20160627172951_create_tree.rb +1 -1
  73. data/test/dummy/db/migrate/20160628173505_add_timestamps.rb +1 -1
  74. data/test/dummy/db/migrate/20170614141921_create_serialize_field.rb +1 -1
  75. data/test/dummy/db/migrate/20181111162121_create_references_table.rb +1 -1
  76. metadata +71 -4
@@ -1,4 +1,4 @@
1
- class CreateReferencesTable < ActiveRecord::Migration
1
+ class CreateReferencesTable < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :references do |t|
4
4
  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: 5.3.2
4
+ version: 6.0.0.pre.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-07 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -178,6 +178,48 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: json
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: json-jwt
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: openid_connect
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
181
223
  description: Forest is a modern admin interface that works on all major web frameworks.
182
224
  forest_liana is the gem that makes Forest admin work on any Rails application (Rails
183
225
  >= 4.0).
@@ -197,6 +239,7 @@ files:
197
239
  - app/controllers/forest_liana/apimaps_controller.rb
198
240
  - app/controllers/forest_liana/application_controller.rb
199
241
  - app/controllers/forest_liana/associations_controller.rb
242
+ - app/controllers/forest_liana/authentication_controller.rb
200
243
  - app/controllers/forest_liana/base_controller.rb
201
244
  - app/controllers/forest_liana/devise_controller.rb
202
245
  - app/controllers/forest_liana/intercom_controller.rb
@@ -232,6 +275,7 @@ files:
232
275
  - app/serializers/forest_liana/stripe_payment_serializer.rb
233
276
  - app/serializers/forest_liana/stripe_subscription_serializer.rb
234
277
  - app/services/forest_liana/apimap_sorter.rb
278
+ - app/services/forest_liana/authentication.rb
235
279
  - app/services/forest_liana/authorization_getter.rb
236
280
  - app/services/forest_liana/base_getter.rb
237
281
  - app/services/forest_liana/belongs_to_updater.rb
@@ -253,8 +297,12 @@ files:
253
297
  - app/services/forest_liana/login_handler.rb
254
298
  - app/services/forest_liana/mixpanel_last_events_getter.rb
255
299
  - app/services/forest_liana/objective_stat_getter.rb
300
+ - app/services/forest_liana/oidc_client_manager.rb
301
+ - app/services/forest_liana/oidc_configuration_retriever.rb
302
+ - app/services/forest_liana/oidc_dynamic_client_registrator.rb
256
303
  - app/services/forest_liana/operator_date_interval_parser.rb
257
304
  - app/services/forest_liana/permissions_checker.rb
305
+ - app/services/forest_liana/permissions_formatter.rb
258
306
  - app/services/forest_liana/permissions_getter.rb
259
307
  - app/services/forest_liana/pie_stat_getter.rb
260
308
  - app/services/forest_liana/query_stat_getter.rb
@@ -277,11 +325,14 @@ files:
277
325
  - app/services/forest_liana/stripe_sources_getter.rb
278
326
  - app/services/forest_liana/stripe_subscription_getter.rb
279
327
  - app/services/forest_liana/stripe_subscriptions_getter.rb
328
+ - app/services/forest_liana/token.rb
280
329
  - app/services/forest_liana/two_factor_registration_confirmer.rb
281
330
  - app/services/forest_liana/user_secret_creator.rb
331
+ - app/services/forest_liana/utils/beta_schema_utils.rb
282
332
  - app/services/forest_liana/value_stat_getter.rb
283
333
  - app/views/layouts/forest_liana/application.html.erb
284
334
  - config/initializers/arel-helpers.rb
335
+ - config/initializers/error-messages.rb
285
336
  - config/initializers/errors.rb
286
337
  - config/initializers/logger.rb
287
338
  - config/initializers/time_formats.rb
@@ -300,6 +351,7 @@ files:
300
351
  - lib/tasks/send_apimap.rake
301
352
  - spec/dummy/README.rdoc
302
353
  - spec/dummy/Rakefile
354
+ - spec/dummy/app/assets/config/manifest.js
303
355
  - spec/dummy/app/assets/javascripts/application.js
304
356
  - spec/dummy/app/assets/stylesheets/application.css
305
357
  - spec/dummy/app/config/routes.rb
@@ -343,14 +395,21 @@ files:
343
395
  - spec/helpers/forest_liana/schema_helper_spec.rb
344
396
  - spec/rails_helper.rb
345
397
  - spec/requests/actions_controller_spec.rb
398
+ - spec/requests/authentications_spec.rb
346
399
  - spec/requests/resources_spec.rb
400
+ - spec/requests/sessions_spec.rb
347
401
  - spec/services/forest_liana/apimap_sorter_spec.rb
348
402
  - spec/services/forest_liana/filters_parser_spec.rb
349
403
  - spec/services/forest_liana/ip_whitelist_checker_spec.rb
404
+ - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
405
+ - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
406
+ - spec/services/forest_liana/permissions_formatter_spec.rb
407
+ - spec/services/forest_liana/permissions_getter_spec.rb
350
408
  - spec/services/forest_liana/schema_adapter_spec.rb
351
409
  - spec/spec_helper.rb
352
410
  - test/dummy/README.rdoc
353
411
  - test/dummy/Rakefile
412
+ - test/dummy/app/assets/config/manifest.js
354
413
  - test/dummy/app/assets/javascripts/application.js
355
414
  - test/dummy/app/assets/stylesheets/application.css
356
415
  - test/dummy/app/controllers/application_controller.rb
@@ -455,9 +514,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
455
514
  version: '0'
456
515
  required_rubygems_version: !ruby/object:Gem::Requirement
457
516
  requirements:
458
- - - ">="
517
+ - - ">"
459
518
  - !ruby/object:Gem::Version
460
- version: '0'
519
+ version: 1.3.1
461
520
  requirements: []
462
521
  rubygems_version: 3.0.8
463
522
  signing_key:
@@ -504,6 +563,7 @@ test_files:
504
563
  - test/dummy/app/helpers/application_helper.rb
505
564
  - test/dummy/app/assets/javascripts/application.js
506
565
  - test/dummy/app/assets/stylesheets/application.css
566
+ - test/dummy/app/assets/config/manifest.js
507
567
  - test/dummy/app/controllers/application_controller.rb
508
568
  - test/dummy/Rakefile
509
569
  - test/dummy/bin/rake
@@ -555,12 +615,18 @@ test_files:
555
615
  - test/dummy/config/database.yml
556
616
  - test/forest_liana_test.rb
557
617
  - test/routing/route_test.rb
618
+ - spec/services/forest_liana/permissions_formatter_spec.rb
619
+ - spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
558
620
  - spec/services/forest_liana/ip_whitelist_checker_spec.rb
621
+ - spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
559
622
  - spec/services/forest_liana/schema_adapter_spec.rb
560
623
  - spec/services/forest_liana/apimap_sorter_spec.rb
561
624
  - spec/services/forest_liana/filters_parser_spec.rb
625
+ - spec/services/forest_liana/permissions_getter_spec.rb
562
626
  - spec/spec_helper.rb
563
627
  - spec/requests/actions_controller_spec.rb
628
+ - spec/requests/sessions_spec.rb
629
+ - spec/requests/authentications_spec.rb
564
630
  - spec/requests/resources_spec.rb
565
631
  - spec/dummy/README.rdoc
566
632
  - spec/dummy/app/views/layouts/application.html.erb
@@ -570,6 +636,7 @@ test_files:
570
636
  - spec/dummy/app/helpers/application_helper.rb
571
637
  - spec/dummy/app/assets/javascripts/application.js
572
638
  - spec/dummy/app/assets/stylesheets/application.css
639
+ - spec/dummy/app/assets/config/manifest.js
573
640
  - spec/dummy/app/config/routes.rb
574
641
  - spec/dummy/app/controllers/application_controller.rb
575
642
  - spec/dummy/Rakefile