diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-27 22:06:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-27 22:06:32 +0300 |
commit | 62e0c3c7d73f028e4c6c8c179d6f04f811a0859f (patch) | |
tree | 69d0c42cb329dd5c64997243608e745dcef77c38 /app/models | |
parent | bbcd372db175c8f19b4b72453ff57c9a19887c5f (diff) |
Add latest changes from gitlab-org/security/gitlab@15-2-stable-ee
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/hooks/web_hook_log.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/hooks/web_hook_log.rb b/app/models/hooks/web_hook_log.rb index 2f03b3591cf..24e5f193a32 100644 --- a/app/models/hooks/web_hook_log.rb +++ b/app/models/hooks/web_hook_log.rb @@ -22,6 +22,7 @@ class WebHookLog < ApplicationRecord validates :web_hook, presence: true before_save :obfuscate_basic_auth + before_save :redact_author_email def self.recent where('created_at >= ?', 2.days.ago.beginning_of_day) @@ -52,4 +53,10 @@ class WebHookLog < ApplicationRecord def obfuscate_basic_auth self.url = safe_url end + + def redact_author_email + return unless self.request_data.dig('commit', 'author', 'email').present? + + self.request_data['commit']['author']['email'] = _('[REDACTED]') + end end |