Skip to content
This repository has been archived by the owner on Aug 17, 2017. It is now read-only.

Add possibility to trust a parameter branch #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sdepold
Copy link

@sdepold sdepold commented Oct 13, 2015

This change introduces a way to mark a specific branch of the parameter
hash as trusted. Using the added StrongParameters::ANY or :* allows
to mark a value of the hash respectively.

This functionality can be handy when your controllers already rely on
strong_parameters and raising of errors is enabled. If the parameter
hash contains in such a case a parameter value which is completely
customizable by the consumer of the controller, it might be impossible
to predefine keys.

Relates to rails/rails#9454

This change introduces a way to mark a specific branch of the parameter
hash as trusted. Using the added `StrongParameters::ANY` or `:*` allows
to mark a value of the hash respectively.

This functionality can be handy when your controllers already rely on
strong_parameters and raising of errors is enabled. If the parameter
hash contains in such a case a parameter value which is completely
customizable by the consumer of the controller, it might be impossible
to predefine keys.
@sdepold sdepold force-pushed the feature/non-scalar-trusted-keys branch from dcf02b8 to f4bf58e Compare October 13, 2015 13:28
@sandstrom
Copy link

Would be very useful, nice!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants