Project

General

Custom queries

Profile

Actions

Feature #3917

closed

Add strong_parameters to foreman

Added by David Davis over 11 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Related issues 19 (1 open18 closed)

Related to Foreman - Bug #7594: extract params defined in apipie documentation to use for strong parametersClosedActions
Related to Foreman - Bug #7568: Use attr_accessible for rails 4 upgradeClosedDaniel Lobato Garcia09/22/2014Actions
Related to Katello - Feature #15741: Use parameter_filter instead of attr_accessibleClosedDavid Davis07/19/2016Actions
Related to Discovery - Refactor #15750: Add strong parameters to Discovery PluginClosedLukas Zapletal07/20/2016Actions
Related to Docker - Feature #15888: Remove calls to attr_accessibleClosedDavid Davis07/28/2016Actions
Related to Foreman - Bug #15951: host's interfaces_attributes compute_attributes not passed to vmClosedTimo Goebel08/03/2016Actions
Related to Salt - Bug #15958: Move to using strong parametersClosedStephen Benjamin08/03/2016Actions
Related to Foreman Remote Execution - Bug #16002: move to strong parametersClosedIvan Necas08/05/2016Actions
Related to Foreman - Bug #16025: Import subnets from proxy returns 500ClosedDaniel Lobato Garcia08/09/2016Actions
Related to OpenSCAP - Bug #16096: Remove attr_accessible from modelsClosedOndřej Pražák08/12/2016Actions
Related to Foreman - Bug #16264: Template combinations cannot be createdClosedDaniel Lobato Garcia08/24/2016Actions
Related to Foreman - Bug #16376: required flag not set from puppetclassClosedDominic Cleal08/30/2016Actions
Related to Foreman - Bug #16578: Resolve templates button throws undefined method `[]' for nil:NilClass on image hostsClosedDominic Cleal09/16/2016Actions
Related to Foreman - Bug #17170: NIC page does not reload when Bond is selectedClosedDominic Cleal11/01/2016Actions
Related to Foreman - Bug #17300: Attached devices not saved when editing bond network interfacesClosedDominic Cleal11/09/2016Actions
Related to Foreman - Bug #19417: keep_params throws error if params don't contain top level hashClosedTomer Brisker04/27/2017Actions
Related to Foreman - Feature #22285: Present error message when passing integer when array expected for API callNewTomer BriskerActions
Is duplicate of Foreman - Bug #1519: rails security problemDuplicate03/06/2012Actions
Blocks Foreman - Tracker #15715: Rails 5.0 upgrade tasksResolved07/18/2016

Actions

Added by Dominic Cleal almost 9 years ago

Revision 12612809 (diff)

fixes #3917 - replace protected_attrs with strong parameters

Filtering of attributes has moved from the protected_attributes gem to
strong parameters in controller concerns, to be in line with current
Rails recommendations.

Concerns are shared between UI and both API controllers and list the
attributes using Foreman::ParameterFilter, which provides additional
features:

1. Registration of additional attributes from plugins, through the
plugin API or `attr_accessible` for short term compatibility.
2. Re-use of permitted attribute lists for nested models (e.g. host
and interface).
3. Combining of lists of attributes from all sources in a single
permit call.
4. A small DSL for changing accepted parameters based on controller,
action and UI/API type.

Plugins should either temporarily depend on protected_attributes to
continue to protect their models or call permit/use ParameterFilter
similarly: http://projects.theforeman.org/projects/foreman/wiki/Strong_parameters

Some UI changes were required to make nested model hash keys all
integers instead of "new_123456" etc, else strong parameters would
filter the entries out.

The Role model's builtin default has been moved from initialize to the
database as the removal of protected_attrs changed the initialisation
order.

Added by Dominic Cleal almost 9 years ago

Packaging - Revision 87526d1e (diff)

refs #3917 - remove protected_attributes requirement

Actions

Also available in: Atom PDF