-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support lazy re-encryption #4
Comments
Reminding a user when it's been over year since last re/encryption - this will require that a user calls it somehow, manually, remembers about it. Perharps, regularly. Namely, once the gem is added and called for the first time, its job is finished and it has no means to run itself in the background to check "how much time has it been since last re-encryption?". This would require creating a Sideq or cron job. But using a background job for an event which occurs only once a year.... Therefore, a user calling the gem will be required. But I think there should be a better way. However, does lazy mean that the gem only checks the last date and reminds a user if needed when it's being called? If so then there'll be no issue described above. But it'll be better to allow the gem somehow notify a user once a year has been passed without requiring a user to call it manually. |
@GildedHonour thanks for the clarification questions. The original 'lazy' meant that the field value is automatically re-encrypted by the system (without user input) when accessed, this was in comparison to a mass re-encryption of all instances of the same field such as using a migration. The second suggested functionality of "reminding" users is that the system does not automatically re-encrypt, but the user has to initiate the re-encryption of those fields using "old / expired" keys. In this case, the system still performs the re-encryption but perhaps the user needs to provide some input (e.g., the new key) to start that. This means that there needs to be some job that runs continuously (or just daily) to notify people about their "expired" keys. In both cases, I think we need a |
Does "the system" refer to the gem? In either case there has to be a cron, sidekiq/whenever task running in background so it can check dayly if re-encryption is needed and then either does re-encryption silently or by notifying a user and asking them for a confirmation. Which means, an external dependency for such a rare task. Sidekiq, for example, is quite heavy; cron requires an effort for a user. Is there a way to avoid using a dependency? Apparently not. |
I'll create a new model and go with the 2 approach which is reminding a user and asking for his input and confirmation. And yes, that'll require a background-tasks library, I'll pick a lightweight one. |
Roadmap #3
The text was updated successfully, but these errors were encountered: