Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: updated the default digest algorithm used for key derivation in ActiveRecord Encryption to SHA256. #51544

Conversation

rhiroe
Copy link
Contributor

@rhiroe rhiroe commented Apr 10, 2024

Motivation / Background

This Pull Request has been created because documentation is not updated.

Detail

This Pull Request changes the document: default digest algorithm used for key derivation in ActiveRecord Encryption from SHA1 to SHA256.

Additional information

Active Record Encryption now uses SHA-256 as its hash digest algorithm.

https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#active-record-encryption-algorithm-changes

irb(main):001> Rails.configuration.active_record.encryption.hash_digest_class
=> OpenSSL::Digest::SHA256
irb(main):002> ActiveRecord::Encryption.config.hash_digest_class
=> OpenSSL::Digest::SHA256

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

…vation in ActiveRecord Encryption to SHA256.

https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#active-record-encryption-algorithm-changes

```ruby
irb(main):001> Rails.configuration.active_record.encryption.hash_digest_class
=> OpenSSL::Digest::SHA256
irb(main):002> ActiveRecord::Encryption.config.hash_digest_class
=> OpenSSL::Digest::SHA256
```
@rhiroe rhiroe force-pushed the doc/Updated-the-default-digest-algorithm-used-for-key-derivation-in-ActiveRocord-Encryption-to-SHA256 branch from a84f52b to 7013b96 Compare April 11, 2024 01:34
yasulab added a commit to yasslab/railsguides.jp that referenced this pull request Apr 11, 2024
This reverts commit 7237436.

もしかしたらアップグレードで7.1にしていた場合のデフォルト値を考慮して
意図的に暗号化アルゴリズムのデフォルトを残しているかもしれないので、
以下のプルリクエストがマージされたら railsguides.jp も更新する方向に寄せました!

rails/rails#51544
@carlosantoniodasilva carlosantoniodasilva merged commit af78e7f into rails:main Apr 11, 2024
1 check failed
carlosantoniodasilva added a commit that referenced this pull request Apr 11, 2024
…algorithm-used-for-key-derivation-in-ActiveRocord-Encryption-to-SHA256

Update the guide reference on the default digest algorithm used
for key derivation in ActiveRecord Encryption to SHA256. [ci skip]
@rhiroe rhiroe deleted the doc/Updated-the-default-digest-algorithm-used-for-key-derivation-in-ActiveRocord-Encryption-to-SHA256 branch April 12, 2024 00:24
yasulab added a commit to yasslab/railsguides.jp that referenced this pull request Apr 12, 2024
This reverts commit 191638f
because the PR to English version below is merged today. 🎉
rails/rails#51544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants