diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 15:08:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 15:08:54 +0300 |
commit | 473b876fe3d7e0b36eb6268cc44a4fe0d94f4422 (patch) | |
tree | 2f6d5f2ecad53015024b6b1509896f5933c5c3e6 /app/models/concerns/application_setting_masked_attrs.rb | |
parent | dca8df0c90d8727d69b3501b15b481546897f3cd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/application_setting_masked_attrs.rb')
-rw-r--r-- | app/models/concerns/application_setting_masked_attrs.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/concerns/application_setting_masked_attrs.rb b/app/models/concerns/application_setting_masked_attrs.rb new file mode 100644 index 00000000000..14a7185e39e --- /dev/null +++ b/app/models/concerns/application_setting_masked_attrs.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# Similar to MASK_PASSWORD mechanism we do for EE, see: +# https://gitlab.com/gitlab-org/gitlab/-/blob/463bb1f855d71fadef931bd50f1692ee04f211a8/ee/app/models/ee/application_setting.rb#L15 +# but for non-EE attributes. +module ApplicationSettingMaskedAttrs + MASK = '*****' + + def ai_access_token=(value) + return if value == MASK + + super + end +end |