-
- Downloads
Don't encrypt boolean settings (by default) (#47179)
* Don't encrypt boolean settings (by default) We have tooling to disable encryption on settings even when the `MB_ENCRYPTION_SECRET_KEY` is set. Turn it on by default for all boolean settings, which don't need to be encrypted. I also optimized the code that decrypts settings on startup because I didn't want to delay startup if someone had set a bunch of boolean settings. With 20 set, the old version added about 200+ ms to startup, about 10ms per boolean setting, whether or not it was encrypted or in the DB already. The optimized version selects all the never-encrypt values from the database at once (a bit silly, but we also just exclude raw `true` and `false` values so we don't bother checking them) and updates them if they're encrypted - this adds ~40ms to startup with 20 encrypted boolean settings (about 2ms per boolean setting) and ~5ms to startup on subsequent runs, when no encrypted values are in the DB.
Showing
- src/metabase/models/setting.clj 18 additions, 12 deletionssrc/metabase/models/setting.clj
- src/metabase/public_settings.clj 0 additions, 1 deletionsrc/metabase/public_settings.clj
- src/metabase/util/encryption.clj 5 additions, 0 deletionssrc/metabase/util/encryption.clj
- test/metabase/models/setting_test.clj 41 additions, 0 deletionstest/metabase/models/setting_test.clj
Loading
Please register or sign in to comment