summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-11-28 11:43:17 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-11-28 11:43:17 +0100
commitb7f35e893999b6cf1bc003747f28861be3412ab1 (patch)
tree5ca8bd63259b33d8407f41441742298894d20244 /lib
parent7d2b37bc48ca3963c241f384c8f2df6e937c74d6 (diff)
downloadgitlab-ce-b7f35e893999b6cf1bc003747f28861be3412ab1.tar.gz
Expire application settings after encrypting tokens
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/background_migration/models/encrypt_columns/settings.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/models/encrypt_columns/settings.rb b/lib/gitlab/background_migration/models/encrypt_columns/settings.rb
index 578d2ee7fbf..7caed7f77aa 100644
--- a/lib/gitlab/background_migration/models/encrypt_columns/settings.rb
+++ b/lib/gitlab/background_migration/models/encrypt_columns/settings.rb
@@ -9,10 +9,15 @@ module Gitlab
#
class Settings < ActiveRecord::Base
include ::EachBatch
+ include ::CacheableAttributes
self.table_name = 'application_settings'
self.inheritance_column = :_type_disabled
+ after_commit do
+ ApplicationSetting.expire
+ end
+
def runners_registration_token=(value)
self.runners_registration_token_encrypted =
::Gitlab::CryptoHelper.aes256_gcm_encrypt(value)