attribute transitional

Ruby on Rails 8.0.4

Since v7.1.6

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

If true, the first two rotation option sets are swapped when building message verifiers. For example, with the following configuration, message verifiers will generate messages using serializer: Marshal, url_safe: true, and will able to verify messages that were generated using any of the three option sets:

verifiers = ActiveSupport::MessageVerifiers.new { ... }
verifiers.rotate(serializer: JSON, url_safe: true)
verifiers.rotate(serializer: Marshal, url_safe: true)
verifiers.rotate(serializer: Marshal, url_safe: false)
verifiers.transitional = true

This can be useful when performing a rolling deploy of an application, wherein servers that have not yet been updated must still be able to verify messages from updated servers. In such a scenario, first perform a rolling deploy with the new rotation (e.g. serializer: JSON, url_safe: true) as the first rotation and transitional = true. Then, after all servers have been updated, perform a second rolling deploy with transitional = false.

Type at least 2 characters to search.

↑↓ navigate · open · esc close