From a03a2c4188bb7370fb24418488776157a59dfac7 Mon Sep 17 00:00:00 2001 From: Eugene Kenny Date: Wed, 28 Oct 2020 23:05:46 +0000 Subject: [PATCH] Improve use_sha1_digests deprecation message We now provide the full setting that maintains the existing behaviour. --- activesupport/CHANGELOG.md | 6 ++++++ activesupport/lib/active_support/railtie.rb | 4 ++-- guides/source/configuring.md | 2 +- railties/CHANGELOG.md | 6 ------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 14c0b08c36..ef3dba6075 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -60,6 +60,12 @@ *Adrianna Chang* +* Allow the digest class used to generate non-sensitive digests to be configured with `config.active_support.hash_digest_class`. + + `config.active_support.use_sha1_digests` is deprecated in favour of `config.active_support.hash_digest_class = ::Digest::SHA1`. + + *Dirkjan Bussink* + * Fix bug to make memcached write_entry expire correctly with unless_exist *Jye Lee* diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index a6390341c7..c36453f7de 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -87,8 +87,8 @@ module ActiveSupport if app.config.active_support.use_sha1_digests ActiveSupport::Deprecation.warn(<<-MSG.squish) config.active_support.use_sha1_digests is deprecated and will - be removed from Rails 6.2. Use config.active_support.hash_digest_class - instead. + be removed from Rails 6.2. Use + config.active_support.hash_digest_class = ::Digest::SHA1 instead. MSG ActiveSupport::Digest.hash_digest_class = ::Digest::SHA1 end diff --git a/guides/source/configuring.md b/guides/source/configuring.md index bc069adb69..8398f4e00f 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -1067,7 +1067,7 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla - `config.active_record.collection_cache_versioning`: `false` - `config.active_record.has_many_inversing`: `false` - `config.active_support.use_authenticated_message_encryption`: `false` -- `config.active_support.use_sha1_digests`: `false` +- `config.active_support.hash_digest_class`: `::Digest::MD5` - `ActiveSupport.utc_to_local_returns_utc_offset_times`: `false` ### Configuring a Database diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index f229aec3a6..3180fb6269 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -15,12 +15,6 @@ *Nick Wolf* -* Deprecate `config.active_support.use_sha1_digests` - - `config.active_support.use_sha1_digests` is deprecated. It is replaced with `config.active_support.hash_digest_class` which allows setting the desired Digest instead. The Rails version defaults have been updated to use this new method as well so the behavior there is unchanged. - - *Dirkjan Bussink* - * Change the default logging level from :debug to :info to avoid inadvertent exposure of personally identifiable information (PII) in production environments.