Commit Graph

66 Commits

Author SHA1 Message Date
Jonathan Hefner
c7303ccc31 Link config settings to the configuration guide [ci-skip]
Since #43138, each config setting has its own linkable section in the
configuration guide.

This commit links config settings throughout the guides to their
sections in the configuration guide.
2022-02-13 13:13:11 -06:00
Jonathan Hefner
4ae7acf00d Fix typos [ci-skip] 2022-02-13 13:07:51 -06:00
mihaic195
3cc91bc1ab
Update rails-on-rack guide on internal middlewares stack 2022-01-18 15:33:43 +02:00
Rafael Mendonça França
4ace047c91
Add back Rack::Runtime to the default middleware stack.
We were planning to remove this middleware because we thought it could
make easier to attacker to do a Time Attack. However, while
Rack::Runtime can indeed be used to know how long a request took, and
compare with other requests, it doesn't provide any information that
can't be found in the total time of the request as well.

Instead of removing the middleware, we decided to keep it, and direct
users to instead of removing it, use its information to uncover actions
that are vulnerable to Time Attack.

This reverts commit 127dd06df66552dd272eea7832f8bb205cf6fd01, reversing
changes made to 4354e3ae492e95934a6da4101556a05d20b9f897.
2021-09-15 18:37:34 -04:00
Hartley McGuire
7bfcf4b313 Remove Rack::Runtime and deprecate referencing it
Previous discussion: #38412, #38325, 37423e4, 24f9c03

- Rack::Runtime is replaced by FakeRuntime, which is a dummy middleware
  that just passes requests on and cannot be used in middleware operations
- Using Rack::Runtime in middleware operations (relative inserts, moves,
  etc.) throws a deprecation warning and uses FakeRuntime instead
- if an application adds Rack::Runtime explicitly (use, unshift, etc.),
  then the deprecation warning does not happen and FakeRuntime is
  ignored
- docs are updated to no longer reference Rack::Runtime
2021-04-12 14:31:12 -04:00
John Bampton
6cf394c236 chore: fix i.e. typos in Markdown and Ruby
i.e. is the customary abbreviation for "that is." It is derived from the Latin term "id est."
2021-04-12 03:30:55 +10:00
Jonathan Hefner
3c9d7a268f Use irb code fences where applicable [ci-skip]
Using `irb` code fences and the appropriate prompt syntax results in
better syntax highlighting.
2020-11-01 16:29:18 -06:00
assain
0f4de21b57 Update GitHub gist api link and fix documentation in api_app page [ci skip]
The GitHub gist API page is out of date. This commit replaces it with
the new link.

Also, removed unnecessary commas, added missing fullstop and fixed
a ruby snippet which wasn't rendered correctly before.
2020-08-06 21:47:45 +05:30
Eugene Kenny
ce81714f1c Highlight CSS code snippets in guides
Also fix the language identifier for one JavaScript example.
2020-07-13 01:28:35 +01:00
mikong
cdde357ab6
Update list of middleware for API-only in Guides
[ci skip]
2020-01-23 12:49:47 +08:00
Ryuta Kamizono
b96990da11 Fix typo s/prefered/preferred/ [ci skip] 2020-01-04 21:10:41 +09:00
Carlos Antonio da Silva
745265ab14 Fix markup on API-only Applications guide [ci skip] 2019-12-31 10:01:56 -03:00
Rafael França
4fbb393b25
Merge pull request #35023 from hahmed/deprecate-global-rails-command-docs
Remove reference to global rails command in the docs
2019-12-27 16:39:55 -03:00
Haroon Ahmed
db1ae8cbb4 remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
Rafael França
0105fd4a1e
Merge pull request #38098 from mltsy/patch-1
Document how to add session middleware to an API app
2019-12-27 11:08:45 -03:00
Joe Marty
3376ab8055
Clarify session management middleware sections
Addresses some comments in original PR for docs on using session management middleware in API apps
2019-12-26 09:25:47 -06:00
Akshay Mohite
e29fb52074
Fixed cache_store name used in adding other modules section of api app documentation. [ci skip]
- Using `mem_cached_store` results in an exception as lib/active_support/cache.rb:106:in `rescue in retrieve_store_class': Could not find cache store adapter for mem_cached_store (cannot load such file -- active_support/cache/mem_cached_store) (RuntimeError)
- Changed the name of cache_store as `mem_cache_store` instead of `mem_cached_store`
2019-08-07 20:34:55 +05:30
st0012
e75452a709 Add ActionController::Caching into api app's document
Rails doesn't support view caching in api controllers by default but the
document didn't clearerly declare this nor the manual config needed
after including the module manually. So we'll see people get confused
like #35602.
2019-04-23 10:31:37 +08:00
Nathaniel Suchy
d9f1cc05b5 Update links and code examples in the guides to use HTTPS where the host supports it. 2019-03-06 15:21:07 -05:00
Genadi Samokovarov
ca62dfeede Cleanup the whitelisting references after #33145
During the development of #33145, I have named a few concepts in the
code as `whitelisted`. We decided to stay away from the term and I
adjusted most of the code afterwards, but here are the cases I forgot to
change.

I also found a case in the API guide that we could have cleaned up as
well.

[ci skip]
2019-02-03 10:58:10 +02:00
Matthew Draper
ec387c6dd9
Merge pull request #33229 from albertoalmagro/albertoalmagro/prefer-rails-command-over-bin-rails
Prefer rails command over bin/rails
2018-07-25 04:10:29 +09:30
Paul McMahon
7b9c19d94b Rails guides are now served over https
http links will be redirected to the https version, but still better to
just directly link to the https version.
2018-07-24 11:29:31 +09:00
Alberto Almagro
40b209db53 Recommend use of rails over bin/rails
As discussed in #33203 rails command already looks for, and runs,
bin/rails if it is present.

We were mixing recommendations within guides and USAGE guidelines,
in some files we recommended using rails, in others bin/rails and
in some cases we even had both options mixed together.
2018-07-06 22:46:35 +02:00
Anthony Crumley
258670244d Added a lot of Oxford commas
[ci skip] A regular expression was used to find a lot of missing Oxford
commas and add them.  The regular expression was as follows.

", ([a-zA-Z0-9.\`:'\"]+ ){1,6}(or|and) "
2018-05-10 12:46:06 -05:00
Yoshiyuki Hirano
2a4122f756 [ci skip] Modify twitter api link in api guide
* The twitter developer site's url was changed.
2018-03-31 19:14:35 +09:00
Derek Prior
4701a50b58
Deprecate controller level force_ssl
Today there are two common ways for Rails developers to force their
applications to communicate over HTTPS:

* `config.force_ssl` is a setting in environment configurations that
  enables the `ActionDispatch::SSL` middleware. With this middleware
  enabled, all HTTP communication to your application will be redirected
  to HTTPS. The middleware also takes care of other best practices by
  setting HSTS headers, upgrading all cookies to secure only, etc.
* The `force_ssl` controller method redirects HTTP requests to certain
  controllers to HTTPS.

As a consultant, I've seen many applications with misconfigured HTTPS
setups due to developers adding `force_ssl` to `ApplicationController`
and not enabling `config.force_ssl`. With this configuration, many
application requests can be served over HTTP such as assets, requests
that hit mounted engines, etc. In addition, because cookies are not
upgraded to secure only in this configuration and HSTS headers are not
set, it's possible for cookies that are meant to be secure to be sent
over HTTP.

The confusion between these two methods of forcing HTTPS is compounded
by the fact that they share an identical name. This makes finding
documentation on the "right" method confusing.

HTTPS throughout is quickly becomming table stakes for all web sites.
Sites are expected to operate over HTTPS for all communication,
sensitive or otherwise. Let's encourage use of the broader-reaching
`ActionDispatch::SSL` middleware and elminate this source of user
confusion. If, for some reason, applications need to expose certain
endpoints over HTTP they can do so by properly configuring
`config.ssl_options`.
2018-03-30 09:58:28 -04:00
Ryuta Kamizono
597b941930 [ci skip] Add missing **DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON http://guides.rubyonrails.org.** 2017-12-15 14:02:25 +09:00
Roman Kovtunenko
1997c9a137 Fix names of http authentication modules in api_app guides 2017-11-19 21:58:08 +02:00
Yoshiyuki Hirano
6b12d02e15 Fix rails middleware list in api_app guide [ci skip]
* `MyApi::Application::Routes` is not middleware.
2017-09-24 05:55:50 +09:00
Yoshiyuki Hirano
bf48e90e69 Use https instead of http in guide [ci skip] 2017-08-23 09:39:45 +09:00
Yoshiyuki Hirano
948c2c48df Use ssl in guide and comment [ci skip] 2017-08-19 08:23:37 +09:00
Mike Gunderloy
ea37cb4cb4
Update Rails API Application guide to match current code [ci skip]
* Adjust list of middlewares loaded by default
* Add routing middleware to list to match the list in the Rack guide
* Adjust list of Controller modules loaded by default

Plus fix one singular/plural mistake
2017-05-21 09:26:02 -05:00
Joe Marty
19ea91837f Document how to add session middleware back
Without this, it's not clear that session middleware has special cases to handle with the `api_only` flag
2017-02-14 16:51:14 -06:00
Vipul A M
e464b3cb3b
Pass over API Apps guide grammar. [ci skip] 2016-05-16 02:56:14 +05:30
Vipul A M
97877e1a23
Add ActiveRecord::Migration::CheckPending to default middlewares for API Apps
[ci skip]
2016-05-16 01:38:16 +05:30
Vijay Dev
83ecf3fe56 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/configuring.md
2016-05-14 09:54:23 +00:00
Vipul A M
26e59e686c
Add output snippet from ActionController::API.ancestors - ActionController::Metal.ancestors command for api apps.
[ci skip]
2016-05-13 23:29:37 +05:30
Vipul A M
c181c9a369
Remove ambiquity in what we are referring to in the documentation of config vs configuring the server itself 2016-05-11 04:01:40 +05:30
willnet
0725f289e1
Replace ActionDispatch::LoadInterlock with ActionDispatch::Executor in guides [ci skip]
Guides should be updated because ActionDispatch::LoadInterlock was replaced with
ActionDispatch::Executor at #23807.
2016-04-30 19:39:38 -07:00
yuuji.yaginuma
0ae20627d5 fix incorrect module name [ci skip] 2016-05-01 10:05:37 +09:00
Vijay Dev
9d1bf059c0 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/configuring.md
2016-04-29 16:00:15 +00:00
Vipul A M
7f9c9d6dcb be specific when the debug_exception_response_format to :api
[ci skip]
2016-04-23 11:22:43 +05:30
Prathamesh Sonpatki
db3f68f4d7
debug_exception_format is set to :api by default for API apps only, not for normal apps.
[ci skip]
2016-04-22 17:17:54 +05:30
Vipul A M
3f2831cd46 Remove reference to unknown method dirty? to docs
[ci skip]
2016-04-19 21:37:50 +05:30
Akshay
afea912a75 [ci skip] Need to mention debug_exception_response_format in the api_app documentation.
- #23771 removed the reference to debug_exception_response_format from the api_app documentation.
- We need to let users know, they have ability to configure debug_exception_response_format in their development environment.
- Added documentation for the same in api_app.md file
- Grammar corrections
2016-02-25 05:03:21 +05:30
yuuji.yaginuma
9ceb0ea8d9 remove needless debug_exception_response_format config [ci skip]
Since a0343d11f1bf80a79e273c1d0cf9934ef2601e98, `debug_exception_response_format` config depends on `api_only`.
Therefore, if set the `api_only`, need to specify `debug_exception_response_format` is not.
2016-02-19 12:37:09 +09:00
Xavier Noria
042bfb8715 partial pass over the API guide [ci skip] 2016-02-18 23:29:29 +01:00
Vijay Dev
9a9587ff30 Separate for new and existing applications clearly
[ci skip]
2016-02-07 07:25:03 +00:00
Vipul A M
acddd032d0 Merge pull request #22857 from bdewater/interlock-doc
Update middleware docs regarding ActionDispatch::LoadInterlock [ci skip]
2016-02-01 01:56:43 +05:30
Bart de Water
6cdc36a026 Update middleware docs regarding ActionDispatch::LoadInterlock [ci skip] 2016-01-31 21:18:37 +01:00