1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

2 commits

Author SHA1 Message Date
yuuji.yaginuma
971cd757ea Use correct variable in secure_compare!
`Messages::Rotator` has `@on_rotation` not `@rotation`.
72bc0806a7/activesupport/lib/active_support/messages/rotator.rb (L11)
2019-07-26 12:51:53 +09:00
Edouard CHIN
123bcf5faa Introduce a new ActiveSupport::SecureCompareRotator class:
- 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')
  ```
2019-06-06 19:08:53 +02:00