inline_forms 8.1.75 → 8.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +56 -1
- data/README.rdoc +1 -1
- data/app/assets/stylesheets/inline_forms/inline_forms.scss +3 -1
- data/app/controllers/inline_forms_controller.rb +61 -14
- data/app/views/inline_forms/_header.html.erb +1 -1
- data/app/views/inline_forms/row_close.html.erb +5 -0
- data/inline_forms.gemspec +0 -1
- data/lib/generators/USAGE +1 -1
- data/lib/generators/inline_forms_addto/USAGE +1 -1
- data/lib/generators/inline_forms_addto_generator.rb +30 -139
- data/lib/generators/inline_forms_attribute_list_editor.rb +211 -0
- data/lib/generators/inline_forms_attribute_overrides.rb +9 -0
- data/lib/generators/inline_forms_generator.rb +16 -35
- data/lib/inline_forms/form_elements/check_list_helper.rb +22 -6
- data/lib/inline_forms/form_elements/dropdown_helper.rb +22 -8
- data/lib/inline_forms/gem_files.rb +20 -17
- data/lib/inline_forms/refused_values.rb +33 -0
- data/lib/inline_forms/version.rb +1 -1
- data/lib/inline_forms.rb +10 -0
- data/lib/locales/inline_forms.en.yml +2 -0
- data/lib/locales/inline_forms.nl.yml +2 -0
- metadata +4 -142
- data/.document +0 -5
- data/.forgejo/brakeman-engine.sh +0 -51
- data/.forgejo/brakeman.ignore +0 -211
- data/.forgejo/workflows/ci.yml +0 -74
- data/.forgejo/workflows/full-gate.yml +0 -104
- data/.gitignore +0 -39
- data/.rubocop.yml +0 -31
- data/.rubocop_todo.yml +0 -151
- data/.ruby-version +0 -1
- data/Gemfile +0 -28
- data/Rakefile +0 -103
- data/script/migrate_form_elements.rb +0 -62
- data/test/archived_form_elements_test.rb +0 -101
- data/test/attribute_list_test.rb +0 -165
- data/test/dummy/app/controllers/application_controller.rb +0 -32
- data/test/dummy/app/controllers/daily_reports_controller.rb +0 -4
- data/test/dummy/app/controllers/documents_controller.rb +0 -4
- data/test/dummy/app/controllers/dossiers_controller.rb +0 -4
- data/test/dummy/app/controllers/gizmos_controller.rb +0 -4
- data/test/dummy/app/controllers/machines_controller.rb +0 -4
- data/test/dummy/app/controllers/parts_controller.rb +0 -4
- data/test/dummy/app/controllers/stats_controller.rb +0 -10
- data/test/dummy/app/controllers/widgets_controller.rb +0 -4
- data/test/dummy/app/helpers/application_helper.rb +0 -13
- data/test/dummy/app/models/ability.rb +0 -15
- data/test/dummy/app/models/application_record.rb +0 -27
- data/test/dummy/app/models/daily_report.rb +0 -21
- data/test/dummy/app/models/document.rb +0 -33
- data/test/dummy/app/models/dossier.rb +0 -38
- data/test/dummy/app/models/gizmo.rb +0 -25
- data/test/dummy/app/models/kind.rb +0 -8
- data/test/dummy/app/models/machine.rb +0 -24
- data/test/dummy/app/models/part.rb +0 -17
- data/test/dummy/app/models/phase.rb +0 -9
- data/test/dummy/app/models/widget.rb +0 -40
- data/test/dummy/app/views/_gizmos_search.html.erb +0 -3
- data/test/dummy/app/views/stats/show.html.erb +0 -1
- data/test/dummy/config/application.rb +0 -49
- data/test/dummy/config/database.yml +0 -3
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/initializers/inline_forms.rb +0 -6
- data/test/dummy/config/initializers/paper_trail_yaml_safe_load.rb +0 -28
- data/test/dummy/config/routes.rb +0 -51
- data/test/form_element_from_callee_test.rb +0 -73
- data/test/gem_package_modes_test.rb +0 -86
- data/test/inline_edit_polymorphic_path_test.rb +0 -81
- data/test/inline_forms_addto_generator_test.rb +0 -584
- data/test/inline_forms_generator_test.rb +0 -301
- data/test/integration/csp_nonce_test.rb +0 -50
- data/test/integration/dropdown_test.rb +0 -186
- data/test/integration/field_authorization_test.rb +0 -131
- data/test/integration/file_slots_test.rb +0 -665
- data/test/integration/html_refusal_test.rb +0 -152
- data/test/integration/inline_forms_crud_test.rb +0 -165
- data/test/integration/layout_title_test.rb +0 -56
- data/test/integration/legacy_elements_test.rb +0 -99
- data/test/integration/list_params_test.rb +0 -200
- data/test/integration/locale_test.rb +0 -234
- data/test/integration/model_top_bar_test.rb +0 -85
- data/test/integration/native_inputs_test.rb +0 -138
- data/test/integration/open_after_create_test.rb +0 -85
- data/test/integration/pending_migration_gate_test.rb +0 -75
- data/test/integration/presentation_escaping_test.rb +0 -80
- data/test/integration/revert_skipped_columns_test.rb +0 -59
- data/test/integration/schema_batch_pipeline_test.rb +0 -189
- data/test/integration/schema_edit_test.rb +0 -141
- data/test/integration/schema_preview_test.rb +0 -65
- data/test/integration/turbo_menu_test.rb +0 -60
- data/test/integration_test_helper.rb +0 -203
- data/test/plain_text_configuration_test.rb +0 -90
- data/test/schema_apply_test.rb +0 -73
- data/test/schema_intent_test.rb +0 -53
- data/test/schema_label_test.rb +0 -61
- data/test/tabs_test.rb +0 -98
- data/test/test_helper.rb +0 -10
- data/test/user_model_config_test.rb +0 -44
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: inline_forms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.1.
|
|
4
|
+
version: 8.1.78
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ace Suares
|
|
@@ -94,20 +94,9 @@ executables: []
|
|
|
94
94
|
extensions: []
|
|
95
95
|
extra_rdoc_files: []
|
|
96
96
|
files:
|
|
97
|
-
- ".document"
|
|
98
|
-
- ".forgejo/brakeman-engine.sh"
|
|
99
|
-
- ".forgejo/brakeman.ignore"
|
|
100
|
-
- ".forgejo/workflows/ci.yml"
|
|
101
|
-
- ".forgejo/workflows/full-gate.yml"
|
|
102
|
-
- ".gitignore"
|
|
103
|
-
- ".rubocop.yml"
|
|
104
|
-
- ".rubocop_todo.yml"
|
|
105
|
-
- ".ruby-version"
|
|
106
97
|
- CHANGELOG.md
|
|
107
|
-
- Gemfile
|
|
108
98
|
- LICENSE.txt
|
|
109
99
|
- README.rdoc
|
|
110
|
-
- Rakefile
|
|
111
100
|
- app/assets/fonts/foundation-icons.svg
|
|
112
101
|
- app/assets/fonts/foundation-icons.ttf
|
|
113
102
|
- app/assets/fonts/foundation-icons.woff
|
|
@@ -215,6 +204,7 @@ files:
|
|
|
215
204
|
- lib/generators/inline_forms_addto/USAGE
|
|
216
205
|
- lib/generators/inline_forms_addto/templates/add_columns_migration.erb
|
|
217
206
|
- lib/generators/inline_forms_addto_generator.rb
|
|
207
|
+
- lib/generators/inline_forms_attribute_list_editor.rb
|
|
218
208
|
- lib/generators/inline_forms_attribute_overrides.rb
|
|
219
209
|
- lib/generators/inline_forms_generator.rb
|
|
220
210
|
- lib/generators/templates/application_record.rb
|
|
@@ -265,6 +255,7 @@ files:
|
|
|
265
255
|
- lib/inline_forms/form_elements/text_field_helper.rb
|
|
266
256
|
- lib/inline_forms/form_elements/time_helper.rb
|
|
267
257
|
- lib/inline_forms/gem_files.rb
|
|
258
|
+
- lib/inline_forms/refused_values.rb
|
|
268
259
|
- lib/inline_forms/schema_apply.rb
|
|
269
260
|
- lib/inline_forms/schema_intent.rb
|
|
270
261
|
- lib/inline_forms/schema_label.rb
|
|
@@ -281,71 +272,6 @@ files:
|
|
|
281
272
|
- lib/otherstuff/roles_users.sql
|
|
282
273
|
- lib/tasks/inline_forms_files.rake
|
|
283
274
|
- lib/vagrant/vagrantbox-inline_forms.zip
|
|
284
|
-
- script/migrate_form_elements.rb
|
|
285
|
-
- test/archived_form_elements_test.rb
|
|
286
|
-
- test/attribute_list_test.rb
|
|
287
|
-
- test/dummy/app/controllers/application_controller.rb
|
|
288
|
-
- test/dummy/app/controllers/daily_reports_controller.rb
|
|
289
|
-
- test/dummy/app/controllers/documents_controller.rb
|
|
290
|
-
- test/dummy/app/controllers/dossiers_controller.rb
|
|
291
|
-
- test/dummy/app/controllers/gizmos_controller.rb
|
|
292
|
-
- test/dummy/app/controllers/machines_controller.rb
|
|
293
|
-
- test/dummy/app/controllers/parts_controller.rb
|
|
294
|
-
- test/dummy/app/controllers/stats_controller.rb
|
|
295
|
-
- test/dummy/app/controllers/widgets_controller.rb
|
|
296
|
-
- test/dummy/app/helpers/application_helper.rb
|
|
297
|
-
- test/dummy/app/models/ability.rb
|
|
298
|
-
- test/dummy/app/models/application_record.rb
|
|
299
|
-
- test/dummy/app/models/daily_report.rb
|
|
300
|
-
- test/dummy/app/models/document.rb
|
|
301
|
-
- test/dummy/app/models/dossier.rb
|
|
302
|
-
- test/dummy/app/models/gizmo.rb
|
|
303
|
-
- test/dummy/app/models/kind.rb
|
|
304
|
-
- test/dummy/app/models/machine.rb
|
|
305
|
-
- test/dummy/app/models/part.rb
|
|
306
|
-
- test/dummy/app/models/phase.rb
|
|
307
|
-
- test/dummy/app/models/widget.rb
|
|
308
|
-
- test/dummy/app/views/_gizmos_search.html.erb
|
|
309
|
-
- test/dummy/app/views/stats/show.html.erb
|
|
310
|
-
- test/dummy/config/application.rb
|
|
311
|
-
- test/dummy/config/database.yml
|
|
312
|
-
- test/dummy/config/environment.rb
|
|
313
|
-
- test/dummy/config/initializers/inline_forms.rb
|
|
314
|
-
- test/dummy/config/initializers/paper_trail_yaml_safe_load.rb
|
|
315
|
-
- test/dummy/config/routes.rb
|
|
316
|
-
- test/form_element_from_callee_test.rb
|
|
317
|
-
- test/gem_package_modes_test.rb
|
|
318
|
-
- test/inline_edit_polymorphic_path_test.rb
|
|
319
|
-
- test/inline_forms_addto_generator_test.rb
|
|
320
|
-
- test/inline_forms_generator_test.rb
|
|
321
|
-
- test/integration/csp_nonce_test.rb
|
|
322
|
-
- test/integration/dropdown_test.rb
|
|
323
|
-
- test/integration/field_authorization_test.rb
|
|
324
|
-
- test/integration/file_slots_test.rb
|
|
325
|
-
- test/integration/html_refusal_test.rb
|
|
326
|
-
- test/integration/inline_forms_crud_test.rb
|
|
327
|
-
- test/integration/layout_title_test.rb
|
|
328
|
-
- test/integration/legacy_elements_test.rb
|
|
329
|
-
- test/integration/list_params_test.rb
|
|
330
|
-
- test/integration/locale_test.rb
|
|
331
|
-
- test/integration/model_top_bar_test.rb
|
|
332
|
-
- test/integration/native_inputs_test.rb
|
|
333
|
-
- test/integration/open_after_create_test.rb
|
|
334
|
-
- test/integration/pending_migration_gate_test.rb
|
|
335
|
-
- test/integration/presentation_escaping_test.rb
|
|
336
|
-
- test/integration/revert_skipped_columns_test.rb
|
|
337
|
-
- test/integration/schema_batch_pipeline_test.rb
|
|
338
|
-
- test/integration/schema_edit_test.rb
|
|
339
|
-
- test/integration/schema_preview_test.rb
|
|
340
|
-
- test/integration/turbo_menu_test.rb
|
|
341
|
-
- test/integration_test_helper.rb
|
|
342
|
-
- test/plain_text_configuration_test.rb
|
|
343
|
-
- test/schema_apply_test.rb
|
|
344
|
-
- test/schema_intent_test.rb
|
|
345
|
-
- test/schema_label_test.rb
|
|
346
|
-
- test/tabs_test.rb
|
|
347
|
-
- test/test_helper.rb
|
|
348
|
-
- test/user_model_config_test.rb
|
|
349
275
|
- vendor/assets/javascripts/popper.min.js
|
|
350
276
|
- vendor/assets/javascripts/tippy-bundle.umd.min.js
|
|
351
277
|
- vendor/assets/javascripts/trix.min.js
|
|
@@ -372,68 +298,4 @@ requirements: []
|
|
|
372
298
|
rubygems_version: 4.0.20
|
|
373
299
|
specification_version: 4
|
|
374
300
|
summary: Inline editing of forms for Rails 8.
|
|
375
|
-
test_files:
|
|
376
|
-
- test/archived_form_elements_test.rb
|
|
377
|
-
- test/attribute_list_test.rb
|
|
378
|
-
- test/dummy/app/controllers/application_controller.rb
|
|
379
|
-
- test/dummy/app/controllers/daily_reports_controller.rb
|
|
380
|
-
- test/dummy/app/controllers/documents_controller.rb
|
|
381
|
-
- test/dummy/app/controllers/dossiers_controller.rb
|
|
382
|
-
- test/dummy/app/controllers/gizmos_controller.rb
|
|
383
|
-
- test/dummy/app/controllers/machines_controller.rb
|
|
384
|
-
- test/dummy/app/controllers/parts_controller.rb
|
|
385
|
-
- test/dummy/app/controllers/stats_controller.rb
|
|
386
|
-
- test/dummy/app/controllers/widgets_controller.rb
|
|
387
|
-
- test/dummy/app/helpers/application_helper.rb
|
|
388
|
-
- test/dummy/app/models/ability.rb
|
|
389
|
-
- test/dummy/app/models/application_record.rb
|
|
390
|
-
- test/dummy/app/models/daily_report.rb
|
|
391
|
-
- test/dummy/app/models/document.rb
|
|
392
|
-
- test/dummy/app/models/dossier.rb
|
|
393
|
-
- test/dummy/app/models/gizmo.rb
|
|
394
|
-
- test/dummy/app/models/kind.rb
|
|
395
|
-
- test/dummy/app/models/machine.rb
|
|
396
|
-
- test/dummy/app/models/part.rb
|
|
397
|
-
- test/dummy/app/models/phase.rb
|
|
398
|
-
- test/dummy/app/models/widget.rb
|
|
399
|
-
- test/dummy/app/views/_gizmos_search.html.erb
|
|
400
|
-
- test/dummy/app/views/stats/show.html.erb
|
|
401
|
-
- test/dummy/config/application.rb
|
|
402
|
-
- test/dummy/config/database.yml
|
|
403
|
-
- test/dummy/config/environment.rb
|
|
404
|
-
- test/dummy/config/initializers/inline_forms.rb
|
|
405
|
-
- test/dummy/config/initializers/paper_trail_yaml_safe_load.rb
|
|
406
|
-
- test/dummy/config/routes.rb
|
|
407
|
-
- test/form_element_from_callee_test.rb
|
|
408
|
-
- test/gem_package_modes_test.rb
|
|
409
|
-
- test/inline_edit_polymorphic_path_test.rb
|
|
410
|
-
- test/inline_forms_addto_generator_test.rb
|
|
411
|
-
- test/inline_forms_generator_test.rb
|
|
412
|
-
- test/integration/csp_nonce_test.rb
|
|
413
|
-
- test/integration/dropdown_test.rb
|
|
414
|
-
- test/integration/field_authorization_test.rb
|
|
415
|
-
- test/integration/file_slots_test.rb
|
|
416
|
-
- test/integration/html_refusal_test.rb
|
|
417
|
-
- test/integration/inline_forms_crud_test.rb
|
|
418
|
-
- test/integration/layout_title_test.rb
|
|
419
|
-
- test/integration/legacy_elements_test.rb
|
|
420
|
-
- test/integration/list_params_test.rb
|
|
421
|
-
- test/integration/locale_test.rb
|
|
422
|
-
- test/integration/model_top_bar_test.rb
|
|
423
|
-
- test/integration/native_inputs_test.rb
|
|
424
|
-
- test/integration/open_after_create_test.rb
|
|
425
|
-
- test/integration/pending_migration_gate_test.rb
|
|
426
|
-
- test/integration/presentation_escaping_test.rb
|
|
427
|
-
- test/integration/revert_skipped_columns_test.rb
|
|
428
|
-
- test/integration/schema_batch_pipeline_test.rb
|
|
429
|
-
- test/integration/schema_edit_test.rb
|
|
430
|
-
- test/integration/schema_preview_test.rb
|
|
431
|
-
- test/integration/turbo_menu_test.rb
|
|
432
|
-
- test/integration_test_helper.rb
|
|
433
|
-
- test/plain_text_configuration_test.rb
|
|
434
|
-
- test/schema_apply_test.rb
|
|
435
|
-
- test/schema_intent_test.rb
|
|
436
|
-
- test/schema_label_test.rb
|
|
437
|
-
- test/tabs_test.rb
|
|
438
|
-
- test/test_helper.rb
|
|
439
|
-
- test/user_model_config_test.rb
|
|
301
|
+
test_files: []
|
data/.document
DELETED
data/.forgejo/brakeman-engine.sh
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Brakeman on a generated app together with the engine code.
|
|
4
|
-
#
|
|
5
|
-
# .forgejo/brakeman-engine.sh APP [extra brakeman options]
|
|
6
|
-
#
|
|
7
|
-
# Brakeman skips gem code, so scanning the app alone never looks at the
|
|
8
|
-
# engine's controllers, helpers and views. Scanning the engine alone does not
|
|
9
|
-
# work either: without an app Brakeman cannot tell the Rails version and the
|
|
10
|
-
# templates do not parse. So: a temporary copy of APP with the engine's code
|
|
11
|
-
# in engines/, scanned as one application. APP itself is not touched.
|
|
12
|
-
#
|
|
13
|
-
# Accepted warnings, each with its reason, are in brakeman.ignore beside this
|
|
14
|
-
# file; --ensure-ignore-notes fails on one without a reason, and
|
|
15
|
-
# --ensure-no-obsolete-ignore-entries on one that no longer occurs. The paths
|
|
16
|
-
# in the copy are relative and fixed (engines/...), because Brakeman's
|
|
17
|
-
# fingerprints include them.
|
|
18
|
-
#
|
|
19
|
-
# Not scanned: lib/installer_templates and lib/generators (they produce code;
|
|
20
|
-
# what they produce is in APP).
|
|
21
|
-
|
|
22
|
-
set -euo pipefail
|
|
23
|
-
|
|
24
|
-
here=$(cd "$(dirname "$0")" && pwd)
|
|
25
|
-
root=$(dirname "$here")
|
|
26
|
-
app=$(cd "${1:?usage: brakeman-engine.sh APP [brakeman options]}" && pwd)
|
|
27
|
-
shift
|
|
28
|
-
|
|
29
|
-
work=$(mktemp -d)
|
|
30
|
-
trap 'rm -rf "$work"' EXIT
|
|
31
|
-
mkdir -p "$work/app/engines/inline_forms" "$work/app/engines/inline_forms_schema_edit"
|
|
32
|
-
|
|
33
|
-
# No keys or credentials: Brakeman does not need them.
|
|
34
|
-
tar -C "$app" --exclude='*.key' --exclude='credentials*' -cf - \
|
|
35
|
-
app config lib Gemfile Gemfile.lock | tar -C "$work/app" -xf -
|
|
36
|
-
|
|
37
|
-
for part in app config lib; do
|
|
38
|
-
if [ -d "$root/$part" ]; then
|
|
39
|
-
cp -R "$root/$part" "$work/app/engines/inline_forms/"
|
|
40
|
-
fi
|
|
41
|
-
if [ -d "$root/inline_forms_schema_edit/$part" ]; then
|
|
42
|
-
cp -R "$root/inline_forms_schema_edit/$part" "$work/app/engines/inline_forms_schema_edit/"
|
|
43
|
-
fi
|
|
44
|
-
done
|
|
45
|
-
rm -rf "$work/app/engines/inline_forms/lib/installer_templates" \
|
|
46
|
-
"$work/app/engines/inline_forms/lib/generators"
|
|
47
|
-
|
|
48
|
-
brakeman --no-pager \
|
|
49
|
-
--add-engines-path engines/inline_forms,engines/inline_forms_schema_edit \
|
|
50
|
-
-i "$here/brakeman.ignore" --ensure-ignore-notes --ensure-no-obsolete-ignore-entries \
|
|
51
|
-
--path "$work/app" "$@"
|
data/.forgejo/brakeman.ignore
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ignored_warnings": [
|
|
3
|
-
{
|
|
4
|
-
"warning_type": "SQL Injection",
|
|
5
|
-
"warning_code": 0,
|
|
6
|
-
"fingerprint": "09d9d139a9c55d2f8ddc853b4e488d8b90a22e81f9b808d5ac60503296a17c40",
|
|
7
|
-
"check_name": "SQL",
|
|
8
|
-
"message": "Possible SQL injection",
|
|
9
|
-
"file": "engines/inline_forms/app/controllers/inline_forms_controller.rb",
|
|
10
|
-
"line": 181,
|
|
11
|
-
"link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
|
|
12
|
-
"code": "(self.controller_name.classify.constantize.accessible_by(current_ability) or self.controller_name.classify.constantize.all).merge(self.controller_name.classify.constantize.inline_forms_list).merge(self.controller_name.classify.constantize.inline_forms_search(params[:search])).where((nil or [\"#{(self.controller_name.classify.constantize.reflect_on_association(params[:parent_class].underscore.to_sym).options[:foreign_key] or params[:parent_class].foreign_key)} = ?\", params[:parent_id]]))",
|
|
13
|
-
"render_path": null,
|
|
14
|
-
"location": {
|
|
15
|
-
"type": "method",
|
|
16
|
-
"class": "InlineFormsController",
|
|
17
|
-
"method": "create"
|
|
18
|
-
},
|
|
19
|
-
"user_input": "params[:parent_class].underscore.to_sym",
|
|
20
|
-
"confidence": "Medium",
|
|
21
|
-
"cwe_id": [
|
|
22
|
-
89
|
|
23
|
-
],
|
|
24
|
-
"note": "parent_class and parent_id are refused (400) by refuse_malformed_parent_params unless parent_class names a belongs_to association of the model and parent_id is all digits; foreign_key comes from the model's reflection or that class name, and parent_id is a bind value. Tests: test/integration/list_params_test.rb."
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"warning_type": "SQL Injection",
|
|
28
|
-
"warning_code": 0,
|
|
29
|
-
"fingerprint": "0ea384debe73789ae09a12359f268b7362bec05090e670f180ab1434d822a012",
|
|
30
|
-
"check_name": "SQL",
|
|
31
|
-
"message": "Possible SQL injection",
|
|
32
|
-
"file": "engines/inline_forms/app/views/inline_forms/_list.html.erb",
|
|
33
|
-
"line": 41,
|
|
34
|
-
"link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
|
|
35
|
-
"code": "(parent_class.find(parent_id).send(attribute) or parent_class.find(parent_id).send(attribute).accessible_by(current_ability)).merge(attribute.to_s.singularize.camelcase.constantize.inline_forms_list).where([\"#{attribute.to_s.singularize.camelcase.constantize.table_name}.#{(parent_class.reflect_on_association(attribute.to_sym).options[:foreign_key] or parent_class.name.foreign_key)} = ?\", parent_id])",
|
|
36
|
-
"render_path": [
|
|
37
|
-
{
|
|
38
|
-
"type": "controller",
|
|
39
|
-
"class": "InlineFormsController",
|
|
40
|
-
"method": "index",
|
|
41
|
-
"line": 105,
|
|
42
|
-
"file": "engines/inline_forms/app/controllers/inline_forms_controller.rb",
|
|
43
|
-
"rendered": {
|
|
44
|
-
"name": "inline_forms/_list",
|
|
45
|
-
"file": "engines/inline_forms/app/views/inline_forms/_list.html.erb"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"location": {
|
|
50
|
-
"type": "template",
|
|
51
|
-
"template": "inline_forms/_list"
|
|
52
|
-
},
|
|
53
|
-
"user_input": "parent_class.reflect_on_association(attribute.to_sym).options[:foreign_key]",
|
|
54
|
-
"confidence": "Weak",
|
|
55
|
-
"cwe_id": [
|
|
56
|
-
89
|
|
57
|
-
],
|
|
58
|
-
"note": "In this branch parent_class is a class passed by _show.html.erb, not a param, and foreign_key is the association's foreign key or the class name's. parent_id is a bind value."
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"warning_type": "Remote Code Execution",
|
|
62
|
-
"warning_code": 24,
|
|
63
|
-
"fingerprint": "61c8f32dd8829cb209a4136d62ff04f729a3f04ea1d1c69b64728ecabc1f4c66",
|
|
64
|
-
"check_name": "UnsafeReflection",
|
|
65
|
-
"message": "Unsafe reflection method `constantize` called on parameter value",
|
|
66
|
-
"file": "engines/inline_forms/app/views/inline_forms/_list.html.erb",
|
|
67
|
-
"line": 19,
|
|
68
|
-
"link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
|
|
69
|
-
"code": "params[:parent_class].constantize",
|
|
70
|
-
"render_path": [
|
|
71
|
-
{
|
|
72
|
-
"type": "controller",
|
|
73
|
-
"class": "InlineFormsController",
|
|
74
|
-
"method": "index",
|
|
75
|
-
"line": 105,
|
|
76
|
-
"file": "engines/inline_forms/app/controllers/inline_forms_controller.rb",
|
|
77
|
-
"rendered": {
|
|
78
|
-
"name": "inline_forms/_list",
|
|
79
|
-
"file": "engines/inline_forms/app/views/inline_forms/_list.html.erb"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"location": {
|
|
84
|
-
"type": "template",
|
|
85
|
-
"template": "inline_forms/_list"
|
|
86
|
-
},
|
|
87
|
-
"user_input": "params[:parent_class]",
|
|
88
|
-
"confidence": "High",
|
|
89
|
-
"cwe_id": [
|
|
90
|
-
470
|
|
91
|
-
],
|
|
92
|
-
"note": "@parent_class is only set in index, new and create, and the before_action refuse_malformed_parent_params covers index, new, create and show: parent_class is blank or the class name of a non-polymorphic belongs_to of the controller's model, so no other class is constantized. Tests: test/integration/list_params_test.rb."
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"warning_type": "Dangerous Send",
|
|
96
|
-
"warning_code": 23,
|
|
97
|
-
"fingerprint": "67076d627523cb3c2746069c8e98d2261b3fcfe04a11463f6eb56e4f10e789a4",
|
|
98
|
-
"check_name": "Send",
|
|
99
|
-
"message": "User controlled method execution",
|
|
100
|
-
"file": "engines/inline_forms/app/controllers/inline_forms_controller.rb",
|
|
101
|
-
"line": 221,
|
|
102
|
-
"link": "https://brakemanscanner.org/docs/warning_types/dangerous_send/",
|
|
103
|
-
"code": "send(\"#{params[:form_element]}_update\", referenced_object, params[:attribute])",
|
|
104
|
-
"render_path": null,
|
|
105
|
-
"location": {
|
|
106
|
-
"type": "method",
|
|
107
|
-
"class": "InlineFormsController",
|
|
108
|
-
"method": "update"
|
|
109
|
-
},
|
|
110
|
-
"user_input": "params[:form_element]",
|
|
111
|
-
"confidence": "High",
|
|
112
|
-
"cwe_id": [
|
|
113
|
-
77
|
|
114
|
-
],
|
|
115
|
-
"note": "field_request_permitted?(:update) runs first and refuses (400) unless attribute and form_element name a row of the model's own attribute list, so only the *_update method of a declared form element can be called."
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"warning_type": "Dangerous Send",
|
|
119
|
-
"warning_code": 23,
|
|
120
|
-
"fingerprint": "6988827dc9c767b44428caabc78a6c8596ad933a406ae1a32b85ae3fd4a4ed23",
|
|
121
|
-
"check_name": "Send",
|
|
122
|
-
"message": "User controlled method execution",
|
|
123
|
-
"file": "engines/inline_forms/app/controllers/inline_forms_controller.rb",
|
|
124
|
-
"line": 259,
|
|
125
|
-
"link": "https://brakemanscanner.org/docs/warning_types/dangerous_send/",
|
|
126
|
-
"code": "referenced_object.send(params[:attribute])",
|
|
127
|
-
"render_path": null,
|
|
128
|
-
"location": {
|
|
129
|
-
"type": "method",
|
|
130
|
-
"class": "InlineFormsController",
|
|
131
|
-
"method": "show"
|
|
132
|
-
},
|
|
133
|
-
"user_input": "params[:attribute]",
|
|
134
|
-
"confidence": "High",
|
|
135
|
-
"cwe_id": [
|
|
136
|
-
77
|
|
137
|
-
],
|
|
138
|
-
"note": "field_request_permitted?(:read) refuses (400) unless attribute and form_element name a row of the model's own attribute list, then authorizes the attribute. With no attribute the send is of nil, which raises. Covers the associated and has_one branches of show."
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"warning_type": "Command Injection",
|
|
142
|
-
"warning_code": 14,
|
|
143
|
-
"fingerprint": "70ea329216e82770ca0de3975a7082e37fe86e417b021e68f95cc6e823e14a77",
|
|
144
|
-
"check_name": "Execute",
|
|
145
|
-
"message": "Possible command injection",
|
|
146
|
-
"file": "engines/inline_forms/lib/inline_forms_installer/create_log.rb",
|
|
147
|
-
"line": 55,
|
|
148
|
-
"link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
|
|
149
|
-
"code": "system(\"bash\", \"-c\", \"#{shell_command} 2>&1 | tee -a #{Shellwords.escape(File.expand_path(basename_for(started_at)))}; exit ${PIPESTATUS[0]}\")",
|
|
150
|
-
"render_path": null,
|
|
151
|
-
"location": {
|
|
152
|
-
"type": "method",
|
|
153
|
-
"class": "InlineFormsInstaller::CreateLog",
|
|
154
|
-
"method": "tee_rails_new"
|
|
155
|
-
},
|
|
156
|
-
"user_input": "shell_command",
|
|
157
|
-
"confidence": "Medium",
|
|
158
|
-
"cwe_id": [
|
|
159
|
-
77
|
|
160
|
-
],
|
|
161
|
-
"note": "Installer command line, not reachable from a web request. shell_command is built by Creator#create from the rails command, the app name (checked against its regex first) and a path in the installer; the operator runs it as themself."
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"warning_type": "Dangerous Send",
|
|
165
|
-
"warning_code": 23,
|
|
166
|
-
"fingerprint": "a858a85120c0ef89f96452d8bcb0d01664507ceb2ae4d834cfc237403b4b93a8",
|
|
167
|
-
"check_name": "Send",
|
|
168
|
-
"message": "User controlled method execution",
|
|
169
|
-
"file": "engines/inline_forms/app/controllers/inline_forms_controller.rb",
|
|
170
|
-
"line": 258,
|
|
171
|
-
"link": "https://brakemanscanner.org/docs/warning_types/dangerous_send/",
|
|
172
|
-
"code": "referenced_object.send((params[:attribute].to_s.singularize + \"_ids\"))",
|
|
173
|
-
"render_path": null,
|
|
174
|
-
"location": {
|
|
175
|
-
"type": "method",
|
|
176
|
-
"class": "InlineFormsController",
|
|
177
|
-
"method": "show"
|
|
178
|
-
},
|
|
179
|
-
"user_input": "(params[:attribute].to_s.singularize + \"_ids\")",
|
|
180
|
-
"confidence": "High",
|
|
181
|
-
"cwe_id": [
|
|
182
|
-
77
|
|
183
|
-
],
|
|
184
|
-
"note": "field_request_permitted?(:read) refuses (400) unless attribute and form_element name a row of the model's own attribute list, so only <association>_ids of a declared association is called."
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"warning_type": "SQL Injection",
|
|
188
|
-
"warning_code": 0,
|
|
189
|
-
"fingerprint": "ad2b4dd8ced8aa1edf48bfbb80730b2bd4dadc84a15de67fd9dde25d81c46e00",
|
|
190
|
-
"check_name": "SQL",
|
|
191
|
-
"message": "Possible SQL injection",
|
|
192
|
-
"file": "engines/inline_forms/app/controllers/inline_forms_controller.rb",
|
|
193
|
-
"line": 64,
|
|
194
|
-
"link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
|
|
195
|
-
"code": "self.controller_name.classify.constantize.all.merge(self.controller_name.classify.constantize.inline_forms_list).merge(self.controller_name.classify.constantize.inline_forms_search(params[:search])).where((nil or [\"#{(self.controller_name.classify.constantize.reflect_on_association(params[:parent_class].underscore.to_sym).options[:foreign_key] or params[:parent_class].foreign_key)} = ?\", params[:parent_id]]))",
|
|
196
|
-
"render_path": null,
|
|
197
|
-
"location": {
|
|
198
|
-
"type": "method",
|
|
199
|
-
"class": "InlineFormsController",
|
|
200
|
-
"method": "index"
|
|
201
|
-
},
|
|
202
|
-
"user_input": "params[:parent_class].underscore.to_sym",
|
|
203
|
-
"confidence": "Medium",
|
|
204
|
-
"cwe_id": [
|
|
205
|
-
89
|
|
206
|
-
],
|
|
207
|
-
"note": "parent_class and parent_id are refused (400) by refuse_malformed_parent_params unless parent_class names a belongs_to association of the model and parent_id is all digits; foreign_key comes from the model's reflection or that class name, and parent_id is a bind value. Tests: test/integration/list_params_test.rb."
|
|
208
|
-
}
|
|
209
|
-
],
|
|
210
|
-
"brakeman_version": "8.1.1"
|
|
211
|
-
}
|
data/.forgejo/workflows/ci.yml
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# CI for Forgejo Actions (runner on dev02, jobs run in Docker containers).
|
|
2
|
-
#
|
|
3
|
-
# No Node: the job runs in the official ruby image (same Ruby as these gems) and
|
|
4
|
-
# uses only shell steps. actions/checkout and actions/cache are JavaScript and
|
|
5
|
-
# need node inside the container, so the checkouts are plain git and the gems
|
|
6
|
-
# are installed fresh each run.
|
|
7
|
-
#
|
|
8
|
-
# GitHub deliberately has NO workflows (.github/workflows was removed in
|
|
9
|
-
# 8.1.34): pushing to GitHub triggers nothing; CI runs only on Forgejo.
|
|
10
|
-
name: CI
|
|
11
|
-
|
|
12
|
-
# Push triggers on EVERY branch (stuff/prompt/workflow.md: "every commit runs
|
|
13
|
-
# through CI") — feature branches were silently skipping CI when this was
|
|
14
|
-
# `branches: [master]`.
|
|
15
|
-
on:
|
|
16
|
-
push:
|
|
17
|
-
pull_request:
|
|
18
|
-
|
|
19
|
-
jobs:
|
|
20
|
-
test:
|
|
21
|
-
runs-on: docker
|
|
22
|
-
container:
|
|
23
|
-
image: docker.io/library/ruby:4.0.10
|
|
24
|
-
steps:
|
|
25
|
-
- name: Check out inline_forms
|
|
26
|
-
env:
|
|
27
|
-
TOKEN: ${{ github.token }}
|
|
28
|
-
SERVER: ${{ github.server_url }}
|
|
29
|
-
REPO: ${{ github.repository }}
|
|
30
|
-
SHA: ${{ github.sha }}
|
|
31
|
-
run: |
|
|
32
|
-
auth=$(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)
|
|
33
|
-
git init -q inline_forms
|
|
34
|
-
cd inline_forms
|
|
35
|
-
git -c http.extraHeader="Authorization: basic $auth" fetch -q --depth 1 "$SERVER/$REPO.git" "$SHA"
|
|
36
|
-
git checkout -q FETCH_HEAD
|
|
37
|
-
git log --oneline -1
|
|
38
|
-
|
|
39
|
-
# The dev Gemfile points at the validation_hints sibling
|
|
40
|
-
# (gem "validation_hints", path: "../validation_hints"). The job's
|
|
41
|
-
# automatic token is scoped to this repo only and validation_hints is
|
|
42
|
-
# private, so the repo secret VALIDATION_HINTS (a token with read
|
|
43
|
-
# access to ace/validation_hints) authorizes the checkout.
|
|
44
|
-
- name: Check out validation_hints
|
|
45
|
-
env:
|
|
46
|
-
TOKEN: ${{ secrets.VALIDATION_HINTS }}
|
|
47
|
-
SERVER: ${{ github.server_url }}
|
|
48
|
-
run: |
|
|
49
|
-
auth=$(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)
|
|
50
|
-
git init -q validation_hints
|
|
51
|
-
cd validation_hints
|
|
52
|
-
git -c http.extraHeader="Authorization: basic $auth" fetch -q --depth 1 "$SERVER/ace/validation_hints.git" HEAD
|
|
53
|
-
git checkout -q FETCH_HEAD
|
|
54
|
-
git log --oneline -1
|
|
55
|
-
|
|
56
|
-
- name: Install gems
|
|
57
|
-
working-directory: inline_forms
|
|
58
|
-
run: |
|
|
59
|
-
bundle config set --local path vendor/bundle
|
|
60
|
-
bundle install --jobs 4
|
|
61
|
-
|
|
62
|
-
- name: Tests (unit + dummy-app integration harness)
|
|
63
|
-
working-directory: inline_forms
|
|
64
|
-
run: bundle exec rake test
|
|
65
|
-
|
|
66
|
-
- name: RuboCop
|
|
67
|
-
working-directory: inline_forms
|
|
68
|
-
run: bundle exec rubocop
|
|
69
|
-
|
|
70
|
-
- name: bundler-audit
|
|
71
|
-
working-directory: inline_forms
|
|
72
|
-
run: |
|
|
73
|
-
gem install bundler-audit --no-document
|
|
74
|
-
bundle-audit check --update
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# The full release gate as a CI job: build all three gems, install them,
|
|
2
|
-
# generate the example app (which runs its own 150+ test suite as part of
|
|
3
|
-
# `inline_forms create`), then run Brakeman against the generated app.
|
|
4
|
-
#
|
|
5
|
-
# Brakeman is aimed at Rails *applications* and skips gem code, so it runs
|
|
6
|
-
# twice: on the generated MyApp (everything the installer writes), and on
|
|
7
|
-
# MyApp together with the engine's own controllers, helpers and views
|
|
8
|
-
# (.forgejo/brakeman-engine.sh; accepted warnings, with their reasons, in
|
|
9
|
-
# .forgejo/brakeman.ignore). bundler-audit for the engine runs in ci.yml.
|
|
10
|
-
#
|
|
11
|
-
# Heavy (~3-4 min: rails new + bundle + migrations + tests), so it runs on
|
|
12
|
-
# demand and weekly, not per push. Requires network access to rubygems.org
|
|
13
|
-
# from the runner (same as Papiamentu's bundle install).
|
|
14
|
-
#
|
|
15
|
-
# No Node: the official ruby image and plain git, as in ci.yml. The generated
|
|
16
|
-
# app's autoprefixer-rails needs a JavaScript runtime; ExecJS takes mini_racer,
|
|
17
|
-
# which `bundle install` installs because no group is excluded (it is in the
|
|
18
|
-
# app's production group).
|
|
19
|
-
name: Full gate
|
|
20
|
-
|
|
21
|
-
on:
|
|
22
|
-
workflow_dispatch:
|
|
23
|
-
schedule:
|
|
24
|
-
- cron: "17 4 * * 1" # Mondays 04:17
|
|
25
|
-
|
|
26
|
-
jobs:
|
|
27
|
-
full-gate:
|
|
28
|
-
runs-on: docker
|
|
29
|
-
container:
|
|
30
|
-
image: docker.io/library/ruby:4.0.10
|
|
31
|
-
steps:
|
|
32
|
-
- name: Check out inline_forms
|
|
33
|
-
env:
|
|
34
|
-
TOKEN: ${{ github.token }}
|
|
35
|
-
SERVER: ${{ github.server_url }}
|
|
36
|
-
REPO: ${{ github.repository }}
|
|
37
|
-
SHA: ${{ github.sha }}
|
|
38
|
-
run: |
|
|
39
|
-
auth=$(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)
|
|
40
|
-
git init -q inline_forms
|
|
41
|
-
cd inline_forms
|
|
42
|
-
git -c http.extraHeader="Authorization: basic $auth" fetch -q --depth 1 "$SERVER/$REPO.git" "$SHA"
|
|
43
|
-
git checkout -q FETCH_HEAD
|
|
44
|
-
git log --oneline -1
|
|
45
|
-
|
|
46
|
-
- name: Check out validation_hints
|
|
47
|
-
env:
|
|
48
|
-
TOKEN: ${{ secrets.VALIDATION_HINTS }}
|
|
49
|
-
SERVER: ${{ github.server_url }}
|
|
50
|
-
run: |
|
|
51
|
-
auth=$(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)
|
|
52
|
-
git init -q validation_hints
|
|
53
|
-
cd validation_hints
|
|
54
|
-
git -c http.extraHeader="Authorization: basic $auth" fetch -q --depth 1 "$SERVER/ace/validation_hints.git" HEAD
|
|
55
|
-
git checkout -q FETCH_HEAD
|
|
56
|
-
git log --oneline -1
|
|
57
|
-
|
|
58
|
-
- name: Build the four gems
|
|
59
|
-
run: |
|
|
60
|
-
cd validation_hints && gem build validation_hints.gemspec && cd ..
|
|
61
|
-
cd inline_forms && gem build inline_forms.gemspec && gem build inline_forms_installer.gemspec
|
|
62
|
-
cd inline_forms_schema_edit && gem build inline_forms_schema_edit.gemspec
|
|
63
|
-
|
|
64
|
-
- name: Install built gems
|
|
65
|
-
run: |
|
|
66
|
-
gem install --no-document \
|
|
67
|
-
validation_hints/validation_hints-*.gem \
|
|
68
|
-
inline_forms/inline_forms-*.gem \
|
|
69
|
-
inline_forms/inline_forms_installer-*.gem \
|
|
70
|
-
inline_forms/inline_forms_schema_edit/inline_forms_schema_edit-*.gem
|
|
71
|
-
|
|
72
|
-
# The installer git-inits the generated app and makes an initial commit
|
|
73
|
-
# (installer_core.rb: `git add .` + `git commit`); a bare container has
|
|
74
|
-
# no git identity and the commit — and with it the whole create — fails
|
|
75
|
-
# ("unable to auto-detect email address", seen in run 3).
|
|
76
|
-
- name: Git identity for the installer's initial commit
|
|
77
|
-
run: |
|
|
78
|
-
git config --global user.email "forgejo-ci@dev02.invalid"
|
|
79
|
-
git config --global user.name "Forgejo CI"
|
|
80
|
-
|
|
81
|
-
# The installer's example gate runs `bundle exec rails test` itself and
|
|
82
|
-
# aborts (non-zero) on any failure — this step IS the release gate.
|
|
83
|
-
# HOME keeps Rails/Bundler caches inside the workspace container.
|
|
84
|
-
- name: Generate example app (runs its own test suite)
|
|
85
|
-
run: |
|
|
86
|
-
mkdir -p apps
|
|
87
|
-
cd apps
|
|
88
|
-
inline_forms create MyApp -d sqlite --example --no-rvm
|
|
89
|
-
|
|
90
|
-
- name: Brakeman against the generated app
|
|
91
|
-
run: |
|
|
92
|
-
gem install brakeman --no-document
|
|
93
|
-
cd apps/MyApp
|
|
94
|
-
# Default check set is ENFORCING (baseline triaged 2026-07-06:
|
|
95
|
-
# 0 warnings; the one ForceSSL finding was fixed in 8.1.36).
|
|
96
|
-
brakeman --no-pager
|
|
97
|
-
# Pedantic full set stays informational: it includes checks that
|
|
98
|
-
# can fire on perfectly reasonable future code.
|
|
99
|
-
brakeman --run-all-checks --no-pager || true
|
|
100
|
-
|
|
101
|
-
# ENFORCING: a warning that is not in .forgejo/brakeman.ignore fails, and
|
|
102
|
-
# so does an entry there that has no reason or no longer occurs.
|
|
103
|
-
- name: Brakeman against the app together with the engine
|
|
104
|
-
run: bash inline_forms/.forgejo/brakeman-engine.sh apps/MyApp
|
data/.gitignore
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# rcov generated
|
|
2
|
-
coverage
|
|
3
|
-
|
|
4
|
-
# rdoc generated
|
|
5
|
-
rdoc
|
|
6
|
-
|
|
7
|
-
# yard generated
|
|
8
|
-
doc
|
|
9
|
-
# ...but not the schema-edit gem's shipped docs: its install generator copies
|
|
10
|
-
# doc/schema-apply-workflow.yml.example into the host app.
|
|
11
|
-
!inline_forms_schema_edit/doc/
|
|
12
|
-
.yardoc
|
|
13
|
-
|
|
14
|
-
# bundler
|
|
15
|
-
.bundle
|
|
16
|
-
|
|
17
|
-
# jeweler generated
|
|
18
|
-
pkg
|
|
19
|
-
|
|
20
|
-
# other (Lemuel I think)
|
|
21
|
-
.project
|
|
22
|
-
.vscode
|
|
23
|
-
|
|
24
|
-
# Builds
|
|
25
|
-
*.gem
|
|
26
|
-
|
|
27
|
-
# Scratch / local notes and secrets (e.g. stuff/forgejo-token). Kept in-repo
|
|
28
|
-
# .gitignore on purpose: the global excludes file that also ignores this is
|
|
29
|
-
# per-machine and is absent on the release box, which let stuff/ leak into
|
|
30
|
-
# `gem build`. Do not rely on the global ignore alone.
|
|
31
|
-
stuff/
|
|
32
|
-
|
|
33
|
-
Gemfile.lock
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# test/dummy runtime artifacts (in-memory DB; only logs/tmp may appear)
|
|
38
|
-
test/dummy/log/
|
|
39
|
-
test/dummy/tmp/
|