aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/secure_compare_rotator_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use correct variable in `secure_compare!`yuuji.yaginuma2019-07-261-0/+13
| | | | | `Messages::Rotator` has `@on_rotation` not `@rotation`. https://github.com/rails/rails/blob/72bc0806a7b378cd544e8fbf7ab22d74b7913ffb/activesupport/lib/active_support/messages/rotator.rb#L11
* Introduce a new ActiveSupport::SecureCompareRotator class:Edouard CHIN2019-06-061-0/+44
- This class is used to rotate a previously determined value to a new one before making the comparions. We use this at Shopify to rotate Basic Auth crendials but I can imagine other use cases. The implementation uses the same `Messages::Rotator` module than the MessageEncryptor/MessageVerifier class so it works exactly the same way. You can use it as follow: ```ruby rotator = ActiveSupport::SecureCompareRotator.new('new_production_value') rotator.rotate('previous_production_value') rotator.secure_compare!('previous_production_value') ```