Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Make `AC::Params#to_h` return Hash with safe keys | Prem Sichanugrist | 2014-08-18 | 1 | -0/+39 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | `ActionController::Parameters#to_h` now returns a `Hash` with unpermitted keys removed. This change is to reflect on a security concern where some method performed on an `ActionController::Parameters` may yield a `Hash` object which does not maintain `permitted?` status. If you would like to get a `Hash` with all the keys intact, duplicate and mark it as permitted before calling `#to_h`. params = ActionController::Parameters.new(name: 'Senjougahara Hitagi') params.to_h # => {} unsafe_params = params.dup.permit! unsafe_params.to_h # => {"name"=>"Senjougahara Hitagi"} safe_params = params.permit(:name) safe_params.to_h # => {"name"=>"Senjougahara Hitagi"} This change is consider a stopgap as we cannot chage the code to stop `ActionController::Parameters` to inherit from `HashWithIndifferentAccess` in the next minor release. Also, adding a CHANGELOG entry to mention that `ActionController::Parameters` will not inheriting from `HashWithIndifferentAccess` in the next major version. | |||||
* | Merge pull request #15933 from rafael/master | Rafael Mendonça França | 2014-06-27 | 1 | -0/+29 | |
|\ | | | | | | | | | | | Add always permitted parameters as a configurable option. [Rafael Mendonça França + Gary S. Weaver] | |||||
| * | Improvements per code review. | Rafael Chacón | 2014-06-27 | 1 | -0/+29 | |
| | | | | | | | | | | | | * General style fixes. * Add changes to configuration guide. * Add missing tests. | |||||
* | | adds some details to the rationale of converted_arrays [ci skip] | Xavier Noria | 2014-06-07 | 1 | -1/+1 | |
| | | ||||||
* | | adds a regression test for the strong params converted arrays cache | Xavier Noria | 2014-06-07 | 1 | -1/+18 | |
| | | | | | | | | This is a regression test for 29844dd. | |||||
* | | Revert "Convert StrongParameters cache to a hash. This fixes an unbounded" | Xavier Noria | 2014-06-07 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot cache keys because arrays are mutable. We rather want to cache the arrays. This behaviour is tailor-made for the usage pattern strongs params is designed for. In a forthcoming commit I am going to add a test that covers why we need to cache by value. Every strong params instance has a live span of a request, the cache goes away with the object. Since strong params have such a concrete intention, it would be interesting to see if there are actually any real-world use cases that are an actual leak, one that practically may matter. I am not convinced that the theoretical leak has any practical consequences, but if it can be shown there are, then I believe we should either get rid of the cache (which is an optimization), or else wipe it in the mutating API. This reverts commit e63be2769c039e4e9ada523a8497ce3206cc8a9b. | |||||
* | | Convert StrongParameters cache to a hash. This fixes an unbounded | Ryan Davis | 2014-06-03 | 1 | -1/+1 | |
| | | | | | | | | | | | | memory leak demonstrated on @tenderlove's latest blog post: http://tenderlovemaking.com/2014/06/02/yagni-methods-are-killing-me.html | |||||
* | | Simple Sungularize ActionController::UnpermittedParameters error in case ↵ | Serj L | 2014-02-24 | 1 | -4/+26 | |
| | | | | | | | | when only 1 parameter is unpermitted. | |||||
* | | unify param.require tests | Arthur Neves | 2014-01-23 | 1 | -10/+0 | |
| | | ||||||
* | | AC::Parameters#permit! permits hashes in array values | Xavier Noria | 2013-12-23 | 1 | -3/+11 | |
| | | ||||||
* | | optimizes array conversion in AC::Parameters | Xavier Noria | 2013-12-21 | 1 | -0/+5 | |
| | | ||||||
* | | converts hashes in arrays of unfiltered params to unpermitted params [fixes ↵ | Xavier Noria | 2013-12-21 | 1 | -0/+7 | |
| | | | | | | | | #13382] | |||||
* | | Revert "Merge pull request #9660 from ↵ | Guillermo Iguaran | 2013-11-02 | 1 | -7/+1 | |
| | | | | | | | | | | | | | | | | | | sebasoga/change_strong_parameters_require_behaviour" This reverts commit c2b5a8e61ba0f35015e6ac949a5c8fce2042a1f2, reversing changes made to 1918b12c0429caec2a6134ac5e5b42ade103fe90. See: https://github.com/rails/rails/pull/9660#issuecomment-27627493 | |||||
* | | Merge pull request #9660 from ↵ | Guillermo Iguaran | 2013-11-01 | 1 | -1/+7 | |
|\ \ | | | | | | | | | | | | | sebasoga/change_strong_parameters_require_behaviour Change ActionController::Parameters#require behavior when value is empty | |||||
| * | | Change ActionController::Parameters#require behavior when value is empty | Sebastian Sogamoso | 2013-03-11 | 1 | -1/+7 | |
| | | | | | | | | | | | | | | | When the value for the required key is empty an ActionController::ParameterMissing is raised which gets caught by ActionController::Base and turned into a 400 Bad Request reply with a message in the body saying the key is missing, which is misleading. With these changes, ActionController::EmptyParameter will be raised which ActionController::Base will catch and turn into a 400 Bad Request reply with a message in the body saying the key value is empty. | |||||
* | | | don't mutate hash with fetch | Doug Cole | 2013-10-26 | 1 | -0/+6 | |
| |/ |/| | ||||||
* | | Strong parameters should permit nested number as key. Closes #12293 | kennyj | 2013-09-27 | 1 | -0/+15 | |
| | | ||||||
* | | do not break params filtering on nil values | Vasiliy Ermolovich | 2013-09-07 | 1 | -0/+9 | |
|/ | | | | closes #12149 | |||||
* | Rack::Test::UploadedFile is a permitted scalar | Fabio Kreusch | 2013-02-21 | 1 | -1/+2 | |
| | ||||||
* | ActionDispatch::Http::UploadedFile is a permitted scalar [Closes #9051] | Xavier Noria | 2013-01-23 | 1 | -1/+2 | |
| | ||||||
* | Lets kepp using Ruby 1.9 syntax | Rafael Mendonça França | 2013-01-22 | 2 | -37/+37 | |
| | ||||||
* | Add missing assert calls | Carlos Antonio da Silva | 2013-01-20 | 1 | -2/+2 | |
| | ||||||
* | strong parameters filters permitted scalars | Xavier Noria | 2013-01-20 | 2 | -17/+164 | |
| | ||||||
* | Restore and adapt the implementation reverted at | Rafael Mendonça França | 2013-01-19 | 2 | -8/+8 | |
| | | | | | | https://github.com/rails/rails/commit/cc1c3c5be061e7572018f734e5239750ab449e3f Now instead of raise, we log by default in development and test | |||||
* | Added ability to raise or log on unpermitted params. | Thomas Drake-Brockman | 2013-01-20 | 2 | -0/+83 | |
| | ||||||
* | Revert "unpermitted params" exception -- it's just not going to work. See ↵ | David Heinemeier Hansson | 2013-01-08 | 1 | -43/+0 | |
| | | | | the discussion on https://github.com/rails/strong_parameters/pull/75. | |||||
* | Never treat action or controller as unpermitted params | David Heinemeier Hansson | 2013-01-08 | 1 | -0/+10 | |
| | ||||||
* | Rename the last occurrence of UnexpectedParameters | Rafael Mendonça França | 2013-01-05 | 1 | -2/+2 | |
| | ||||||
* | Rename the configuration to raise_on_unpermitted_parameters | Rafael Mendonça França | 2013-01-05 | 1 | -4/+4 | |
| | | | | Also changed the exception to UnpermittedParameters | |||||
* | Allow developers to enable raising of exception when unexpected params are ↵ | Thomas Drake-Brockman | 2013-01-05 | 1 | -0/+33 | |
| | | | | provided. | |||||
* | hash filters should be accessed with symbols or strings | Francesco Rodriguez | 2012-11-30 | 1 | -0/+25 | |
| | ||||||
* | Test that permitted? is sticky on accessors, mutators, and merges | Benjamin Quorning | 2012-11-06 | 1 | -0/+24 | |
| | ||||||
* | Test that not permitted is sticky on #except | Benjamin Quorning | 2012-11-06 | 1 | -0/+1 | |
| | ||||||
* | Current tests are testing stickiness of non-permitted parameters | Benjamin Quorning | 2012-11-06 | 1 | -3/+3 | |
| | ||||||
* | Fix buggy tests | Benjamin Quorning | 2012-11-06 | 1 | -4/+4 | |
| | ||||||
* | No need for the debugger | David Heinemeier Hansson | 2012-10-31 | 1 | -1/+0 | |
| | ||||||
* | Allow #permit to take its list of permitted parameters as an array | David Heinemeier Hansson | 2012-10-31 | 1 | -0/+5 | |
| | ||||||
* | Permit string and float values in the multiparameter attributes | Rafael Mendonça França | 2012-10-18 | 1 | -9/+14 | |
| | ||||||
* | Cleanup trailing whitespaces | dfens | 2012-10-12 | 1 | -1/+1 | |
| | ||||||
* | When executing permit with just a key that points to a hash, DO NOT allow ↵ | Santiago Pastorino | 2012-10-12 | 1 | -1/+5 | |
| | | | | | | | | | | | | | | all the hash params.require(:person).permit(:projects_attributes) was returning => {"projects_attributes"=>{"0"=>{"name"=>"Project 1"}}} When should return => {} You should be doing ... params.require(:person).permit(projects_attributes: :name) to get just the projects attributes you want to allow | |||||
* | Allow parameter filters to match multi-parameter attributes | Rafael Mendonça França | 2012-10-05 | 1 | -0/+33 | |
| | | | | | | | This will make easier to permit date/time attributes generated by helpers like date_select. [Sven Schwyn + Rafael Mendonça França] | |||||
* | ActionController::Parameters#permit! is recursive | Brendan Loudermilk | 2012-10-04 | 1 | -0/+7 | |
| | ||||||
* | Correct parameter access. | Philip Arndt | 2012-09-19 | 1 | -1/+1 | |
| | | | * The params as supplied pass born in authors[0] but not authors[1] so it seems like the test isn't covering what it should be covering. | |||||
* | Support fields_for attributes, which may have numeric symbols as hash keys | Guillermo Iguaran | 2012-09-16 | 1 | -0/+18 | |
| | ||||||
* | Add config.action_controller.permit_all_attributes to bypass ↵ | Guillermo Iguaran | 2012-09-16 | 1 | -0/+14 | |
| | | | | StrongParameters protection | |||||
* | Change tainted/untainted wording to permitted/forbidden | Guillermo Iguaran | 2012-09-16 | 1 | -1/+1 | |
| | ||||||
* | Don't use assert_nothing_raised when assert_equal is used | Guillermo Iguaran | 2012-09-16 | 1 | -4/+2 | |
| | ||||||
* | require abstract_unit in parameters tests | Guillermo Iguaran | 2012-09-16 | 3 | -0/+3 | |
| | ||||||
* | Integrate ActionController::Parameters from StrongParameters gem | Guillermo Iguaran | 2012-09-16 | 3 | -0/+163 | |