aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller.rb
Commit message (Collapse)AuthorAgeFilesLines
* active_support/rails has to be required via abstract_controller.rbAkira Matsuda2019-07-121-1/+0
|
* Adds support for configuring HTTP Feature Policy (#33439)Jacob Bednarz2019-07-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A HTTP feature policy is Yet Another HTTP header for instructing the browser about which features the application intends to make use of and to lock down access to others. This is a new security mechanism that ensures that should an application become compromised or a third party attempts an unexpected action, the browser will override it and maintain the intended UX. WICG specification: https://wicg.github.io/feature-policy/ The end result is a HTTP header that looks like the following: ``` Feature-Policy: geolocation 'none'; autoplay https://example.com ``` This will prevent the browser from using geolocation and only allow autoplay on `https://example.com`. Full feature list can be found over in the WICG repository[1]. As of today Chrome and Safari have public support[2] for this functionality with Firefox working on support[3] and Edge still pending acceptance of the suggestion[4]. #### Examples Using an initializer ```rb # config/initializers/feature_policy.rb Rails.application.config.feature_policy do |f| f.geolocation :none f.camera :none f.payment "https://secure.example.com" f.fullscreen :self end ``` In a controller ```rb class SampleController < ApplicationController def index feature_policy do |f| f.geolocation "https://example.com" end end end ``` Some of you might realise that the HTTP feature policy looks pretty close to that of a Content Security Policy; and you're right. So much so that I used the Content Security Policy DSL from #31162 as the starting point for this change. This change *doesn't* introduce support for defining a feature policy on an iframe and this has been intentionally done to split the HTTP header and the HTML element (`iframe`) support. If this is successful, I'll look to add that on it's own. Full documentation on HTTP feature policies can be found at https://wicg.github.io/feature-policy/. Google have also published[5] a great in-depth write up of this functionality. [1]: https://github.com/WICG/feature-policy/blob/master/features.md [2]: https://www.chromestatus.com/feature/5694225681219584 [3]: https://bugzilla.mozilla.org/show_bug.cgi?id=1390801 [4]: https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/33507907-support-feature-policy [5]: https://developers.google.com/web/updates/2018/06/feature-policy
* Include default headers by default in API modeKevin Deisz2018-04-061-0/+1
| | | | ActionDispatch's default headers are now moved into their own module that are by default included in both Base and API. This allows API-mode applications to take advantage of the default security headers, as well as providing an easy way to add more.
* Add DSL for configuring Content-Security-Policy headerAndrew White2017-11-271-0/+1
| | | | https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
* [Action Pack] require => require_relativeAkira Matsuda2017-10-211-2/+2
| | | | | This basically reverts e9fca7668b9eba82bcc832cb0061459703368397, d08da958b9ae17d4bbe4c9d7db497ece2450db5f, d1fe1dcf8ab1c0210a37c2a78c1ee52cf199a66d, and 68eaf7b4d5f2bb56d939f71c5ece2d61cf6680a3
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* [Action Controller] require => require_relativeAkira Matsuda2017-07-011-2/+2
|
* Include the content of the flash in the auto-generated etag (#26250)David Heinemeier Hansson2016-08-221-0/+1
| | | Include the content of the flash in the auto-generated etag
* Allow specifying encoding of parameters by actionKerri Miller2016-08-091-0/+1
| | | | | At GitHub we need to handle parameter encodings that are not UTF-8. This patch allows us to specify encodings per parameter per action.
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-13/+13
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Move Caching module to Abstract ControllerRafael Mendonça França2016-02-231-6/+4
| | | | | | Abstract Controller is the common component between Action Mailer and Action Controller so if we need to share the caching component it need to be there.
* Re-add ActionController::ApiRenderingJon Moss2016-01-201-0/+4
| | | | | - Fixes bug #23142. - Bug was occurring only with ActionController::API, because `_process_options` wasn't being run for API requests, even though it was being run for normal app requests.
* remove RackDelegation moduleAaron Patterson2015-08-261-1/+0
| | | | | | Since all controller instances are required to have a request and response object, RackDelegation is no longer needed (we always have to delegate to the response)
* Return 204 if render is not called in API controllersJorge Bejar2015-06-111-0/+1
|
* Remove Compatibility module since we don't remember why it was added :smile:Jorge Bejar2015-06-111-1/+0
|
* Remove api_rendering is not neededSantiago Pastorino2015-06-111-4/+0
|
* Add ActionController API functionalitySantiago Pastorino2015-06-111-0/+5
|
* Override default form builder for a controllerKevin McPhillips2015-04-131-0/+1
|
* Add ActionController::Rendererbrainopia2015-01-221-0/+1
| | | | Render arbitrary templates outside of controller actions
* remove autoload HideActions, no longer existyuuji.yaginuma2015-01-111-1/+0
|
* Responder was removed at ee77770d57de9da87b05a2fe84b9d46ec6852c62Akira Matsuda2014-09-301-1/+0
|
* When your templates change, browser caches bust automatically.Jeremy Kemper2014-08-171-0/+1
| | | | | | | | | | | | | | | | New default: the template digest is automatically included in your ETags. When you call `fresh_when @post`, the digest for `posts/show.html.erb` is mixed in so future changes to the HTML will blow HTTP caches for you. This makes it easy to HTTP-cache many more of your actions. If you render a different template, you can now pass the `:template` option to include its digest instead: fresh_when @post, template: 'widgets/show' Pass `template: false` to skip the lookup. To turn this off entirely, set: config.action_controller.etag_with_template_digest = false
* Remove deprecated cattr_* requiresGenadi Samokovarov2013-12-031-1/+1
|
* Remove BasicRendering testsJosé Valim2013-09-091-1/+0
|
* Load HTML in ActionView not ActionPackŁukasz Strzałkowski2013-08-251-1/+0
| | | | HTML Scanner is part of ActionView and it should be loaded along with it
* Fist stab on basic renderingŁukasz Strzałkowski2013-08-251-0/+1
|
* Do not load AV inside APŁukasz Strzałkowski2013-08-251-8/+0
| | | | Move that part to AV railtie
* Remove deprecated constants autoloadCarlos Antonio da Silva2013-07-021-3/+0
| | | | | These constants were removed in 4b97ce5eb16cc20207516387fba98bf577e2e281, but I forgot to remove the autoload calls :sparkles:.
* Remove ActionController::RecordIdentifier was deprecated.kennyj2013-06-011-4/+0
|
* extract PerformanceTest into rails-performance_tests gemYves Senn2013-01-101-1/+0
|
* Add config.action_controller.permit_all_attributes to bypass ↵Guillermo Iguaran2012-09-161-0/+1
| | | | StrongParameters protection
* Integrate ActionController::Parameters from StrongParameters gemGuillermo Iguaran2012-09-161-0/+1
|
* Sprockets-rails tests failDmitry Vorotilin2012-09-011-1/+0
| | | | | | | Method invalid_asset_host! was delegated to controller but sprockets compile assets in their own scope without controller. And if we set asset_host with second parameter it should raise error through invalid_asset_host!. But since controller is nil it cannot be reached.
* Don't require action_dispatch in ActionView::UrlHelpersPiotr Sarnacki2012-08-281-0/+4
| | | | | | | | | | ActionDispatch::Routing::UrlFor was always required in UrlHelpers. This was changed by splitting previous implementation of UrlHelper into 2 modules: ActionView::Helpers::UrlHelper and ActionView::Routing::UrlHelper. The former one keeps only basic implementation of url_for. The latter adds features that allow to use routes and is only required when url_helpers or mounted_helpers are required.
* Move action_controller/vendor/html-scanner to action_viewPiotr Sarnacki2012-08-281-1/+1
| | | | | | This is another step in moving Action View's dependencies in Action Pack to Action View itself. Also, HtmlScanner seems to be better suited for views rather than controllers.
* Deprecate ActionController::RecordIdentifierPiotr Sarnacki2012-08-281-0/+4
|
* Move ActionController::RecordIdentifier to ActionViewPiotr Sarnacki2012-08-281-4/+0
| | | | | | | Since it's more about DOM classes and ids it belongs to Action View better. What's more, it's more convenient to make it part of Action View to follow the rule that Action Pack can depend on Action View, but not the other way round.
* Remove dependency on actionpack in ActionView::AssetPathsPiotr Sarnacki2012-08-281-0/+1
| | | | | | Since Action View should not depend on actionpack, it's best to delegate invalid_asset_host! to controller and just rely on such simple contract instead of raising ActionController::RoutingError directly.
* Get rid of config.preload_frameworks in favor of config.eager_load_namespacesJosé Valim2012-08-211-0/+6
| | | | | | | The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly.
* load active_support/core_ext/module/delegation in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/concern in active_support/railsXavier Noria2012-08-021-1/+0
|
* defines a private require-hub active_support/railsXavier Noria2012-08-021-0/+1
| | | | | | | | This is a private place to put those AS features that are used by every component. Nowadays we cherry-pick individual files wherever they are used, but that it is not worth the effort for stuff that is going to be loaded for sure sooner or later, like blank?, autoload, concern, etc.
* added live responses which can be written and read in separate threadsAaron Patterson2012-07-291-0/+1
|
* Remove --http.José Valim2012-03-141-1/+0
|
* Add ActionController::HTTPSantiago Pastorino2012-03-141-0/+1
| | | | | | More info http://edgeguides.rubyonrails.org/api_app.html [Carlos Antonio da Silva & Santiago Pastorino]
* Remove unused ActionController::SessionManagementSantiago Pastorino2012-03-061-1/+0
|
* remove autoload UrlWriter, no longer existsVishnu Atrai2012-01-291-1/+0
|
* Revert the serializers API as other alternatives are now also under discussionJosé Valim2011-11-251-1/+0
|
* Initial commit of serializer supportJose and Yehuda2011-10-151-0/+1
|
* TODO fix explicitly loading exceptations, autoload removedVishnu Atrai2011-07-111-15/+0
|