rails/railties/test/application
bogdanvlviv 9b455fe6f0
Prevent leaking of user's DB credentials on rails db:create failure
Issue #27852 reports that when `rails db:create` fails, it causes
leaking of user's DB credentials to $stderr.
We print a DB's configuration hash in order to help users more quickly
to figure out what could be wrong with his configuration.

This commit changes message from
"Couldn't create database for #{configuration.inspect}" to
"Couldn't create '#{configuration['database']}' database. Please check your configuration.".

There are two PRs that fixing it #27878, #27879, but they need a bit more work.
I decided help to finish this and added Author of those PRs credit in this commit.

Since it is a security issue, I think we should backport it to
`5-2-stable`, and `5-1-stable`.
Guided by https://edgeguides.rubyonrails.org/maintenance_policy.html#security-issues

Fixes #27852
Closes #27879
Related to #27878

[Alexander Marrs & bogdanvlviv]
2018-08-29 12:40:30 +03:00
..
configuration Use respond_to test helpers 2018-01-25 23:32:58 -05:00
initializers Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
middleware Purpose Metadata For Signed And Encrypted Cookies 2018-08-12 21:50:35 +05:30
rack Log the remote IP addr of clients behind a proxy 2018-07-31 20:45:37 +05:30
rake Prevent leaking of user's DB credentials on rails db:create failure 2018-08-29 12:40:30 +03:00
asset_debugging_test.rb Pass the skip_pipeline option in image_submit_tag 2018-03-14 11:18:06 +00:00
assets_test.rb Fix CustomCops/AssertNot to allow it to have failure message 2018-05-13 11:32:47 +09:00
bin_setup_test.rb Remove unnecessary migration deletion 2017-11-08 13:24:16 +09:00
configuration_test.rb Add test case that configure config.action_view.finalize_compiled_template_methods 2018-05-20 10:19:12 +09:00
console_test.rb Use respond_to test helpers 2018-01-25 23:32:58 -05:00
content_security_policy_test.rb Remove trailing semi-colon from CSP 2018-02-19 12:20:43 +00:00
current_attributes_integration_test.rb Don't need the layout here 2017-09-04 05:44:45 +09:30
dbconsole_test.rb Remove redundant execution of Dir.chdir(app_path) { } in railties' tests 2017-10-08 23:04:04 +03:00
generators_test.rb Do not show credentials in generators help 2017-11-09 20:59:16 +09:00
help_test.rb Run in-app rails commands via fork+load where possible 2017-09-04 20:19:39 +09:30
integration_test_case_test.rb rails new runs rails active_storage:install 2017-11-06 21:29:14 +00:00
loading_test.rb Use lazy load hook to configure ActiveStorage::Blob 2018-02-25 00:54:27 +00:00
mailer_previews_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
middleware_test.rb Multipart file uploads are very rare in API only apps so don't include Rack::TemfileReaper in default middleware stack for API only apps 2018-02-17 15:52:41 -05:00
multiple_applications_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
paths_test.rb Fix CustomCops/AssertNot to allow it to have failure message 2018-05-13 11:32:47 +09:00
per_request_digest_cache_test.rb Include ActiveSupport::Testing::MethodCallAssertions in railties/test/isolation/abstract_unit.rb 2018-06-09 00:00:28 +03:00
rackup_test.rb Remove unnecessary migration deletion 2017-11-08 13:24:16 +09:00
rake_test.rb Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
rendering_test.rb Fix RenderingTest in railtie 2018-04-04 06:12:24 +09:00
routing_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
runner_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
server_test.rb Enable Lint/StringConversionInInterpolation rubocop rule 2018-05-21 21:10:14 +09:00
test_runner_test.rb Ensure that running tests in parallel doesn't display schema load output 2018-08-08 16:20:38 +03:00
test_test.rb Add test parallelization to Rails 2018-02-15 19:21:24 -05:00
url_generation_test.rb Add credentials using a generic EncryptedConfiguration class (#30067) 2017-09-11 20:21:20 +02:00
version_test.rb Run in-app rails commands via fork+load where possible 2017-09-04 20:19:39 +09:30