-
Notifications
You must be signed in to change notification settings - Fork 22k
Allow on_rotation
in MessageEncryptor to be passed in constructor:
#36270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ac1a51f
to
59c20fd
Compare
cc/ @rafaelfranca (since I know you declared bankruptcy on notifications recently 😄) |
I'm curious what you're doing in |
thanks for the feedbacks, pushed a new commit.
Yeah just passing data to statsd to know when the old secrets is no longer used. |
8b8e0a5
to
95e9974
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we just got to get a passing build.
I've been trying to rebuild but then the checkout fails https://buildkite.com/rails/rails/builds/61568#_
Thanks I'll try to amend/force push a bit later today. Might just be some network blips |
- Use case: I'm writing a wrapper around MessageEncryptor to make things easier to rotate a secret in our app. It works something like ```ruby crypt = RotatableSecret.new(['old_secret', 'new_secret']) crypt.decrypt_and_verify(message) ``` I'd like the caller to not have to care about passing the `on_rotation` option and have the wrapper deal with it when instantiating the MessageEncryptor object. Also, almost all of the time the on_rotation should be the same when rotating a secret (logging something or StatsD event) so I think it's not worth having to repeat ourselves each time we decrypt a message.
95e9974
to
a5502f4
Compare
should be good now |
Allow
on_rotation
in MessageEncryptor to be passed in constructor:Use case:
I'm writing a wrapper around MessageEncryptor to make things easier
to rotate a secret in our app.
It currently works something like
I'd like the caller to not have to care about passing the
on_rotation
option and have the wrapper deal with it wheninstantiating the MessageEncryptor object.
Also, almost all of the time the on_rotation should be the same when
rotating a secret (logging something or StatsD event) so I think
it's not worth having to repeat ourselves each time we decrypt a message.