-
- Downloads
Encrypt application settings with pre and post deployments
We had concerns about the cached values on Redis with the previous two releases strategy: First release (this commit): - Create new encrypted fields in the database. - Start populating new encrypted fields, read the encrypted fields or fallback to the plaintext fields. - Backfill the data removing the plaintext fields to the encrypted fields. Second release: - Remove the virtual attribute (created in step 2). - Drop plaintext columns from the database (empty columns after step 3). We end up with a better strategy only using migration scripts in one release: - Pre-deployment migration: Add columns required for storing encrypted values. - Pre-deployment migration: Store the encrypted values in the new columns. - Post-deployment migration: Remove the old unencrypted columns
Showing
- app/models/application_setting.rb 0 additions, 24 deletionsapp/models/application_setting.rb
- db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb 0 additions, 6 deletions...0_encrypt_plaintext_attributes_on_application_settings.rb
- db/post_migrate/20191122135327_remove_plaintext_columns_from_application_settings.rb 28 additions, 0 deletions...327_remove_plaintext_columns_from_application_settings.rb
- db/schema.rb 1 addition, 7 deletionsdb/schema.rb
- spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb 2 additions, 2 deletions...rypt_plaintext_attributes_on_application_settings_spec.rb
- spec/models/application_setting_spec.rb 0 additions, 44 deletionsspec/models/application_setting_spec.rb
Please register or sign in to comment