2017-09-23 17:16:21 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ActiveSupport
|
|
|
|
module Messages
|
2017-09-24 13:02:12 -04:00
|
|
|
class RotationConfiguration # :nodoc:
|
2017-09-23 17:16:21 -04:00
|
|
|
attr_reader :signed, :encrypted
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
@signed, @encrypted = [], []
|
|
|
|
end
|
|
|
|
|
2019-09-19 04:36:40 -04:00
|
|
|
def rotate(kind, *args, **options)
|
2020-02-08 22:56:16 -05:00
|
|
|
args << options unless options.empty?
|
2017-09-23 17:16:21 -04:00
|
|
|
case kind
|
|
|
|
when :signed
|
2020-02-08 22:56:16 -05:00
|
|
|
@signed << args
|
2017-09-23 17:16:21 -04:00
|
|
|
when :encrypted
|
2020-02-08 22:56:16 -05:00
|
|
|
@encrypted << args
|
2017-09-23 17:16:21 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|