2023-05-02 14:21:41 +02:00
|
|
|
# TODO: Enable cookies rotation when new SHA256 will be enforced
|
|
|
|
# See new_framework_defaults_7.0.rb
|
|
|
|
# key_generator_hash_digest_class = OpenSSL::Digest::SHA256 will be
|
|
|
|
#
|
|
|
|
# Rails.application.config.after_initialize do
|
|
|
|
# Rails.application.config.action_dispatch.cookies_rotations.tap do |cookies|
|
|
|
|
# salt = Rails.application.config.action_dispatch.authenticated_encrypted_cookie_salt
|
|
|
|
# secret_key_base = Rails.application.secret_key_base
|
2023-03-30 11:40:41 +02:00
|
|
|
|
2023-05-02 14:21:41 +02:00
|
|
|
# key_generator = ActiveSupport::KeyGenerator.new(
|
|
|
|
# secret_key_base, iterations: 1000, hash_digest_class: OpenSSL::Digest::SHA1
|
|
|
|
# )
|
|
|
|
# key_len = ActiveSupport::MessageEncryptor.key_len
|
|
|
|
# secret = key_generator.generate_key(salt, key_len)
|
2023-03-30 11:40:41 +02:00
|
|
|
|
2023-05-02 14:21:41 +02:00
|
|
|
# cookies.rotate :encrypted, secret
|
|
|
|
# end
|
|
|
|
# end
|