Skip to content

Consider setting action_on_unpermitted_parameters to :raise in development and/or test #551

@G-Rath

Description

@G-Rath

strong_parameters uses action_on_unpermitted_parameters to control what happens when an unpermitted param is found, which can be set to false, :log, or :raise.

The default for production is "false" whereas in development and test it's :log but maybe we should set it to :raise for the latter?

It makes sense for it to be silent in production because ultimately anything can be passed to our endpoints, but that's also why I think it would make sense to be very loud in dev and test as we should only be getting expected params.

I don't think historically we've had any significant issues or bugs around params that this would catch, but I have come across some instances of unpermitted params being filtered in apps (most commonly with the CSRF token) which raises my eyebrows as I'm usually hunting down a niche bug, so I think it could be a way of improving our hygiene a bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussDiscussion required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions